C Program To Reverse String

C Program To Reverse String

#include<stdio.h>
#include<string.h>

main()
{

char str[20];
int i,len;

printf("Enter string:\n");
scanf("%s",str);

len=strlen(str);

for(i=len-1;i>=0;i--)
{

printf("%c",str[i]);

}

printf("\n");

}

Related Posts