write a program to reverse a string in c language.
#include<stdio.h>
#include<conio.h>
#include<string.h>
int main()
{
char str[10];
int len,i;
printf("enter a string\n");
scanf("%s",str);
len=strlen(str);
for(i=len-1;i>=0;i--)
{
printf("%c",str[i]);
}
return 0;
}
Comments
Post a Comment