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 are the different types of pointers used in c language?
What does 3 mean in texting?
What is const and volatile in c?
Is main is user defined function?
Explain what is meant by high-order and low-order bytes?
What is a rvalue?
A c program to display count values from 0 to 100 and flash each digit for a secong.reset the counter after it reaches 100.use for loop,. pls guys hepl me.. :(
What are the 4 types of functions?
Tell us something about keyword 'auto'.
What is null pointer constant?
Can the “if” function be used in comparing strings?
what are bit fields in c?
what will be the output for the following main() { printf("hi" "hello"); }
What is the process to generate random numbers in c programming language?
how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software