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
Where are c variables stored in memory?
What are identifiers and keywords in c?
Describe wild pointers in c?
In a switch statement, explain what will happen if a break statement is omitted?
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
What is null pointer constant?
What is the purpose of the statement: strcat (S2, S1)?
What is the purpose of main() function?
Create a simple code fragment that will swap the values of two variables num1 and num2.
Explain what is the difference between a free-standing and a hosted environment?
What are directives in c?
Why do we use header files in c?
what are # pragma staments?
Where in memory are my variables stored?
How can you draw circles in C?