pgm to reverse string using arrays i.e god is love becomes
love is god)
(assumption:only space is used for seperation of words)

no addtional memory used.i.e no temporary arrays can used.

Answer Posted / paaru

#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char a[20],i;
printf("\n\nEnter the string:");
gets(a);
for(i=strlen(a)-1;i>=0;i++)
{
printf("%d"a[i]);
}
getch();
}

Is This Answer Correct ?    1 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Where are c variables stored in memory?

597


What are identifiers and keywords in c?

571


Describe wild pointers in c?

638


In a switch statement, explain what will happen if a break statement is omitted?

637


If a five digit number is input through the keyboard, write a program to print a new number by adding one to each of its digits.For example if the number that is input is 12391 then the output should be displayed as 23402

3247






What is null pointer constant?

594


What is the purpose of the statement: strcat (S2, S1)?

642


What is the purpose of main() function?

656


Create a simple code fragment that will swap the values of two variables num1 and num2.

811


Explain what is the difference between a free-standing and a hosted environment?

635


What are directives in c?

545


Why do we use header files in c?

580


what are # pragma staments?

1628


Where in memory are my variables stored?

635


How can you draw circles in C?

623