hamaXD

Final 57 printReverse

Dec 5th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.33 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<string.h>
  3. void printReverse(char x[]);
  4. int main(){
  5.    
  6.     char x[50];
  7.     gets(x);
  8.     printReverse(x);
  9.     printf("\n%s",x);
  10.  
  11.     return  0;
  12. }
  13. void printReverse(char x[]){
  14.     char y[50];
  15.     int i=0;
  16.     int size = strlen(x)-1;
  17.     while(i<50){
  18.         y[i]=x[size];
  19.         i++;
  20.         size--;
  21.     }
  22.     printf("printReverse : %s",y);
  23. }
Add Comment
Please, Sign In to add comment