Community Sites
Create your own community website and start earning today !
It's Free !
Forum
Resources
Mentors
Projects
Entrance Exams
Question Papers
Colleges
Courses
Universities
Schools
Make Money
Communities
Members
Bookmarks
Polls
Fresher Jobs
Strange Photos
Academic Projects
New Member FAQ
My Profile
Sign In
Register
AdSense Revenue
Active Members
Today
eldho
(170)
Anil
(103)
lukky
(72)
Last 7 Days
Saagar
(1818)
sunil
(1772)
satish
(1735)
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.
C Program of reversing a string using stack
Posted Date: 24 Mar 2008 Resource Type:
Articles/Knowledge Sharing
Category:
Computer & Technology
Posted By:
ashish singh
Member Level:
Diamond
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
(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
!
Related Resources
C++ program for single link list manipulation
Google Mobile
making mozilla 10 times faster
Java Program-Sort contents file
Multimedia Database
Watch TV Channels
Watch Asianet online
Kairali TV in Internet
Surya TV online
Amritha TV Channel
Contact Us
Editors
Privacy Policy
Terms Of Use
SpiderWorks Technologies Pvt Ltd. 2006 - 2007 All Rights Reserved.