New Member FAQ
|
Forums
|
Earn Revenue
Resources
Entrance
Ask Experts
Exam Papers
Jobs
English
Projects
Universities
Colleges
Courses
Schools
Training
My India
Members
|
Communities
|
Business Directory
|
Classifieds
|
Reviews
|
Silverlight Games
|
Peer Appraisal
|
Bookmarks
|
Polls
|
Mentors
|
Links
|
Academic Projects
|
Lobby
|
Gift Shop
|
Chat
My Profile
Sign In
Register
AdSense Revenue
Active Members
Today
suresh
(20)
Jackson Josera...
(19)
Latha Jayaprak...
(12)
Last 7 Days
Shobha Manasa
(1548)
Aira
(1346)
Lenin
(1158)
more...
Awards & Gifts
Online Exams
Aptitude Questions
General Aptitude Tests
Medical Entrance
Engineering Entrance
Bank Tests
TOEFL & IELTS Questions
Fresher Jobs
Our fresher job section is exclusively for fresh graduates! Find jobs for freshers in major Indian cities including Bangalore, Chennai, Hyderabad, Pune or Kochi
Resources
Find educational articles, blogs, discussion threads and other resources.
Colleges
Find details about any college in India or search for courses.
Resources
»
Articles/Knowledge Sharing
»
Computer & Technology
»
C Program of reversing a string using stack
Posted Date: 24 Mar 2008
Resource Type:
Articles/Knowledge Sharing
Category:
Computer & Technology
Author:
ashish singh
Member Level:
Gold
Rating:
Points
: 2
/* Program of reversing a string using stack */
#include
#define MAX 20
#include
int top = -1;
char stack[MAX];
char pop();
push(char);
main()
{
char str[20];
int i;
printf("Enter the string : " );
gets(str);
/*Push characters of the string str on the stack */
for(i=0;i
push(str[i]);
/*Pop characters from the stack and store in string str */
for(i=0;i
str[i]=pop();
printf("Reversed string is : ");
puts(str);
}/*End of main()*/
push(char item)
{
if(top == (MAX-1))
printf("Stack Overflow\n");
else
stack[++top] =item;
}/*End of push()*/
char pop()
{
if(top == -1)
printf("Stack Underflow\n");
else
return stack[top--];
}/*End of pop()*/
Responses
Author:
Prasad
10 Aug 2008
Member Level:
Gold
Points
: 0
Excellence in technical education and research
Feedbacks
Popular Tags
What are tags ?
Search Tags
Sign In
to add tags.
(No tags found.)
Post Feedback
This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must
Sign In
to post a response.
Next Resource:
C Program of queue using linked list
Previous Resource:
C Program of sparse matrix for 3-tuple method using array
Return to Discussion Resource Index
Post New Resource
Category:
Computer & Technology
Post resources and
earn money
!
More Resources
C Program of queue using array
C Program of queue using circular linked list
C Program of priority queue using linked list
C Program for conversion of infix to postfix and evaluation of postfix
C Program to check nesting of parentheses using stack
C Program of input and output restricted dequeue using array
Advertise Here
Watch TV Channels
Watch Asianet online
Kairali TV in Internet
Surya TV online
Amritha TV Channel
Contact Us
Advertise
Editors
Privacy Policy
Terms Of Use
ISC Technologies.
2006 - 2009 All Rights Reserved.