Page

code for reverse string in c language

#include<stdio.h>
#include<conio.h>
void main()
{
char a[50],j,i=0;
clrscr();
printf("Enter the String:\n");
printf("The Reverse Of The Given String is\n");
while((a[i]=getchar())!='\n')i++;
for(j=i-1;j>=0;j--)
{
printf("%c",a[j]);
}
getch();
}

No comments:

Post a Comment