nahidhasan110

string revarse

Dec 7th, 2019
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.25 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<string.h>
  3. int main()
  4. {
  5.     char st[50],st1[50];
  6.     gets(st);
  7.     int i,l,j;
  8.     l=strlen(st);
  9.     for(i=l-1,j=0;i>=0;i--,j++)
  10.     {
  11.         st1[j]=st[i];
  12.     }
  13.     st1[j]='\0';
  14.     printf("%s",st1);
  15.     return 0;
  16. }
Add Comment
Please, Sign In to add comment