Saturday, August 6, 2011

WAP TO REVERSE A STRING.

//WAP TO REVERSE A STRING.
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char A[20];
clrscr();
puts("\nENTER THE STRING:");
gets(A);
puts("\n\nENTERED STRING IS");
puts("\n\n");
puts(A);
strrev(A);
printf("\n\nAFTER REVERSING STRING IS:%s",A);
getch();
}
/*---------------------------------------------------------
OUTPUT
-----------------------------------------------------------
ENTER THE STRING:
ABHISHEK


ENTERED STRING IS



ABHISHEK


AFTER REVERSING STRING IS:KEHSIHBA
*/

No comments:

Post a Comment

Post a Comment

Programming the Whole World!