Niloy007

Pranto's Problem 3

Mar 23rd, 2021
570
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data