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
How is = symbol different from == symbol in c programming?
Is file a keyword in c?
Is calloc better than malloc?
What is #define size in c?
write a program to print data of 5 five students with structures?
What do you mean by a sequential access file?
What are the various types of control structures in programming?
write a C program: To search a file any word which starts with ?a?. If the word following this ?a? starts with a vowel.Then replace this ?a? with ?a? with ?an?. redirect with the output onto an output file.The source file and destination file are specified by the user int the command line.
What is a pragma?
What is the meaning of 2d in c?
What is optimization in c?
i = 25;switch (i) {case 25: printf("The value is 25 ");case 30: printf("The value is 30 "); When the above statements are executed the output will be : a) The value is 25 b) The value is 30 c) The value is 25 The value is 30 d) none
What are preprocessor directives in c?
What is openmp in c?
Where we use clrscr in c?