#include<stdio.h>
#include<string.h>
///reverse a sentence
int main()
{
int i,length,count=0;
char ch[20];
printf("Enter the string:");
gets(ch);
length=strlen(ch);
for(i=0; i<length; i++)
{
count++;
}
printf("Reverse is:");
for(i=count-1; i>=0; i--)
{
printf("%c",ch[i]);
}
return 0;
}
No comments:
Post a Comment