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



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

Answer / 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

More C Interview Questions

How does normalization of huge pointer works?

0 Answers  


int x=5; printf("%d%d%d",x,x<<2,x>>2);

2 Answers   TANCET,


How can I change their mode to binary?

0 Answers  


What are bit fields? What is their use?

2 Answers   Adobe,


Is c is a low level language?

0 Answers  


What are pragmas and what are they good for?

0 Answers  


Which is more efficient, a switch statement or an if else chain?

0 Answers  


#define DCHAR char* typedef char* TCHAR; if using these following variables will be declared like DCHAR ch1, ch2; TCHAR ch3, ch4; then what will be types of ch1, ch2, ch3 and ch4?

6 Answers   NDS,


Dear Sir, we are required the bubble sorting programs Regs Prem

1 Answers  


write a program to arrange the contents of a 1D array in ascending order

4 Answers  


i have a written test in tomorrow

1 Answers   NNN, Value Labs,


What is the difference between NULL and NUL?

0 Answers   Aspire, Infogain,


Categories