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


Please Help Members By Posting Answers For Below Questions

How pointer is different from array?

583


What is the purpose of sprintf?

623


How does normalization of huge pointer works?

641


GIVEN A FLOATING POINT NUMBER HOW IS IT ACTUALLY STORED IN MEMORY ? CAN ANYONE EXPLAIN?? THE 32 BIT REPRESENTATION OF A FLOATING POINT NUMBER ALLOTS: 1 BIT-SIGN 8 BITS-EXPONENT 23 BITS-MANTISSA

1431


Explain About fork()?

648






What is Dynamic memory allocation in C? Name the dynamic allocation functions.

559


Explain what is a const pointer?

642


Function calling procedures? and their differences? Why should one go for Call by Reference?

635


What is the full form of getch?

585


Is main is a keyword in c?

610


What is clrscr in c?

681


Sir,please help me out with the code of this question. Write an interactive C program that will encode or decode multiple lines of text. Store the encoded text within a data file, so that it can be retrieved and decoded at any time. The program should include the following features: (a) Enter text from the keyboard, encode the text and store the encoded text in a data file. (b) Retrieve the encoded text and display it in its encoded form. (c) Retrieve the encoded text, decode it and then display the decoded text. (d) End the computation. Test the program using several lines of text of your choice.

1768


What is the data segment that is followed by c?

615


Explain the priority queues?

626


while loop contains parts a) initialisation, evalution of an expression,increment /decrement b) initialisation, increment/decrement c) condition evalution d) none of the above

742