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 to write a bubble sort program without using temporary variable?

1 Answers   Aricent,


Tell me when is a void pointer used?

0 Answers  


how to copy a string without using c function

5 Answers  


code snippet for creating a pyramids triangle ex 1 2 2 3 3 3

4 Answers  


who is the father of c

4 Answers   Infosys,






Write a program that receives as input a number omaadel-n-print, four digits.

0 Answers  


What does main () mean in c?

0 Answers  


Tell me with an example the self-referential structure?

0 Answers  


There are N egg baskets and the number of eggs in each basket is a known quantity. Two players take turns to remove these eggs from the baskets. On each turn, a player must remove at least one egg, and may remove any number of eggs provided they all belong to the same basket. The player picking the last egg(s) wins the game. If you are allowed to decide who is going to start first, what mathematical function would you use to decide so that you end up on the winning side? Upload a C program to demonstrate the behaviour of the game.

2 Answers  


explain about storage of union elements.

2 Answers   ABC, Bosch,


write a c program to find the roots of a quadratic equation ax2 + bx + c = 0

11 Answers   CSC, St Marys, TATA,


Is printf a keyword?

0 Answers  


Categories