Write a C program where input is: "My name is xyz". output
is: "xyz is name My".
Answer Posted / 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 View All Answers
A banker has a seif with a cipher. Not to forget the cipher, he wants to write it coded as following: each digit to be replaced with the difference of 9 with the current digit. The banker chose a cipher. Decipher it knowing the cipher starts with a digit different than 9. I need to write a program that takes the cipher from the keyboard and prints the new cipher. I thought of the following: Take the input from the keyboard and put it into a string or an array. Go through the object with a for and for each digit other than the first, substract it from 9 and add it to another variable. Print the new variable. Theoretically I thought of it but I don't know much C. Could you give me any kind of hint, whether I am on the right track or not?
What is a example of a variable?
How is a null pointer different from a dangling pointer?
Can the curly brackets { } be used to enclose a single line of code?
How is a structure member accessed?
What is the meaning of ?
#include
What is the meaning of typedef struct in c?
What is New modifiers?
In a switch statement, what will happen if a break statement is omitted?
What is the use of void pointer and null pointer in c language?
What are the usage of pointer in c?
What is getch() function?
what does static variable mean?
Where in memory are my variables stored?