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 / ruchi
#include<stdio.h>
#include<conio.h>
int main()
{
int i=0,c;
char a[20];
printf("\nEnter the string");
while((a[i++]=getchar())!='\n');
printf("\nReverse of the string is ");
for(c=i;c>=0;c++)
{
printf("%c"a[c]);
}
getch();
}
Is This Answer Correct ? | 1 Yes | 5 No |
Post New Answer View All Answers
what is the format specifier for printing a pointer value?
List the difference between a 'copy constructor' and a 'assignment operator' in C?
Explain indirection?
How can a program be made to print the line number where an error occurs?
What are qualifiers and modifiers c?
What is the difference between array and structure in c?
What are valid operations on pointers?
What is the use of putchar function?
How does placing some code lines between the comment symbol help in debugging the code?
What does the format %10.2 mean when included in a printf statement?
How can you find out how much memory is available?
What is the difference between typedef struct and struct?
What are two dimensional arrays alternatively called as?
How many main () function we can have in a project?
Explain what does the characters 'r' and 'w' mean when writing programs that will make use of files?