Write a C program where input is: "My name is xyz". output
is: "xyz is name My".

Answer Posted / suneel

step1: First find length of the string
step2: Reverse the string and stored in another string
temp[]="zxy si eman ym";
step3:
Store each charecter in the temp[] to stack
when it is not a space
step4: If it is space then pop the all characters in the stack
and stored in o/p
step5: The process is done upto null

Is This Answer Correct ?    14 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what is the heap?

806


How can I recover the file name given an open stream?

755


2) Write a program that will help Air Traffic Control for an airport to view the sequence of flights ready for take-off. The airport can accommodate 10 flights waiting for take-off at any point in time. Each flight has a unique 3 digit numeric identifier.  Each time a flight takes-off, Air Traffic Control adds a flight to the waitlist. Each time a flight is added to the waitlist, the list of flights waiting to take-off must be displayed.  When a flight is cleared for take-off, Air Traffic Control removes the flight from the waitlist. Each time a flight takes-off, the list of flights waiting to take-off must be displayed.  Sequence of take-off is the sequence of addition to the waitlist

2713


What is the difference between exit() and _exit() function in c?

835


What are pointers in C? Give an example where to illustrate their significance.

972


What is volatile variable in c?

858


How can a process change an environment variable in its caller?

921


What is #ifdef ? What is its application?

855


What does %c do in c?

780


What is difference between union All statement and Union?

875


c program for searching a student details among 10 student details

1876


What is #include called?

801


What is a program?

915


void main(int n) { if(n==0) return; main(--n); printf("%d ",n); getch(); } how it work and what will be its output...............it any one know ans plz reply

2507


How do we declare variables in c?

792