Advertisement
sujonshekh

String Reverse

Aug 5th, 2016
1,041
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<stdio.h>
  2. #include<string.h>
  3.  
  4. int main()
  5. {
  6.     char str[100], rev[100];
  7.     gets(str);
  8.     int i,j=0;
  9.     for(i=strlen(str)-1;i>= 0;i--)
  10.     {
  11.         rev[j] = str[i];
  12.         j++;
  13.         //printf("%c", str[i]);
  14.     }
  15.     puts(rev);
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement