viewing paste Unknown #5550 | C

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
/* max test script */
#include<stdio.h>
#include<string.h>
main()
{
 char str[50],revstr[50];
 int i=0,j=0;
 printf("Enter the string to be reversed : ");
 scanf("%s",str);
 for(i=strlen(str)-1;i>=0;i--)
 {
 revstr[j]=str[i];
 j++;
 }
 revstr[j]='\0';
 printf("Input String : %s",str);
 printf("\nOutput String : %s",revstr);
 getch();
}
Viewed 281 times, submitted by unknown.