Advertisement
rafikamal

Reverse Print

Jan 28th, 2013
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.28 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. void print_reverse(char s[], int position);
  4.  
  5. int main()
  6. {
  7.     print_reverse("Bangladesh", 0);
  8.    
  9.     return 0;
  10. }
  11.  
  12. void print_reverse(char s[], int position)
  13. {
  14.     if(s[position] == '\0')
  15.         return;
  16.     print_reverse(s, position+1);
  17.     printf("%c", s[position]);
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement