Advertisement
rony-Rony_05

problem 1

Jul 2nd, 2019
94
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. int reverse( num)
  3. {
  4.     int r;
  5. int r_num=0;
  6.     while(num!=0)
  7. {
  8.     r=num%10;
  9.     r_num=r_num*10+r;
  10.     num=num/10;
  11. }
  12.     return r_num;
  13. }
  14.  
  15. int main()
  16. {
  17. int num,r,temp;
  18. printf("Enter a number:");
  19. scanf("%d",&num);
  20. printf("Orginal number:%d",num);
  21.  
  22. printf("\nReverse number:%d",reverse(num));
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement