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

who is the founder of c

19 Answers   College School Exams Tests, HP,


C,c++, Java is all are structural oriented or procedure oriented language..?

6 Answers  


whats the use of header file in c?

2 Answers  


What is extern storage class in c?

0 Answers  


Explain about block scope in c?

0 Answers  






What are categories used for in c?

0 Answers  


How will you divide two numbers in a MACRO?

0 Answers   Apps Associates,


write a addition of two no. program with out using printf,scanf,puts .

4 Answers  


suppose we use switch statement and we intilize years name using enum statement like(jan,feb,mar,------dec) we take integer value as an input .question is that the month which we analyz is from 0 to 11 bt if i enter 12 than how he again starts from begning and print jan

1 Answers  


What is sizeof array?

0 Answers  


What is the use of printf() and scanf() functions?

0 Answers  


What is echo in c programming?

0 Answers  


Categories