Advertisement
Theerayut

Word

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