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 many bytes are occupied by near, far and huge pointers (dos)?

0 Answers  


Explain what is the difference between functions abs() and fabs()?

0 Answers  


what is difference between declaring the pointer as int and char in c language?

3 Answers  


send me the code of flow chart generator using C-programming language amd this code should calculate the time and space complexity of the given progran and able to generate flowchart according to the given program?

0 Answers   TCS,


44.what is the difference between strcpy() and memcpy() function? 45.what is output of the following statetment? 46.Printf(“%x”, -1<<4); ? 47.will the program compile? int i; scanf(“%d”,i); printf(“%d”,i); 48.write a string copy function routine? 49.swap two integer variables without using a third temporary variable? 50.how do you redirect stdout value from a program to a file? 51.write a program that finds the factorial of a number using recursion?

6 Answers   Amdocs,






What is context in c?

0 Answers  


what are the program that using a two dimensional array that list the odd numbers and even numbers separately in a given 10 inputs values

0 Answers   College School Exams Tests,


1.what are local and global variables? 2.what is the scope of static variables? 3.what is the difference between static and global variables? 4.what are volatile variables? 5.what is the use of 'auto' keyword? 6.how do we make a global variable accessible across files? Explain the extern keyword? 7.what is a function prototype? 8.what does keyword 'extern' mean in a function declaration?

2 Answers   nvidia,


#ifdef TRUE int I=0; #endif main() { int j=0; printf("%d %d\n",i,j); }

3 Answers   ADITI,


How we can set and clear bit in a byte using macro function?

2 Answers   L&T, Samsung,


How to declare a variable?

0 Answers  


how does a general function , that accepts an array as a parameter, "knows" the size of the array ? How should it define it parameters list ?

0 Answers  


Categories