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


Please Help Members By Posting Answers For Below Questions

What is character set?

676


What is a constant?

626


What are 3 types of structures?

586


What is array of structure in c programming?

743


What is restrict keyword in c?

635






What is static identifier?

693


Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.

642


what are the program that using a two dimensional array that list the odd numbers and even numbers separately in a given 10 inputs values

1253


What is binary tree in c?

617


What is assert and when would I use it?

573


Write a program to print fibonacci series using recursion?

580


What are two dimensional arrays alternatively called as?

650


What is the use of define in c?

588


Which is the memory area not included in C program? give the reason

1495


Why we use int main and void main?

533