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

What is #define?

0 Answers  


Why do we use static in c?

0 Answers  


Define Spanning-Tree Protocol (STP)

0 Answers  


What will happen when freeing memory twice

2 Answers  


Write a programme using structure that create a record of students. The user allow to add a record and delete a record and also show the records in ascending order.

0 Answers   Sikkim Manipal University,


c program to input values in a table(using 2D array) and print odd numbers from them

1 Answers  


can we access one file to one directory?

1 Answers  


Write a program to use switch statement.

0 Answers   Agilent, Integreon, ZS Associates,


write a c/c++ program that takes a 5 digit number and calculates 2 power that number and prints it?

4 Answers  


How do you determine if a string is a palindrome?

1 Answers  


define switch statement?

6 Answers   CTS,


write a program in c language that uses function to locate and return the smallest and largest integers in an array,number and their position in the array. it should also find and return the range of the numbers , that is , the difference between the largest number and the smallest.

1 Answers  


Categories