Advertisement
Niloy007

Pranto's Problem 3

Mar 23rd, 2021
781
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 <math.h>
  3.  
  4. int main() {
  5.     int reverse = 0, n;
  6.     printf("Enter a nuber:\n");
  7.     scanf("%d", &n);
  8.     int num = n;
  9.  
  10.     while (n > 0) {
  11.         reverse = (reverse * 10) + (n % 10);
  12.         n /= 10;
  13.     }
  14.     printf("Reverse of %d is: %d\n", num, reverse);
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement