1#include <stdio.h>
2int main() {
3 int n, rev = 0, remainder;
4 printf("Enter an integer: ");
5 scanf("%d", &n);
6 while (n != 0) {
7 remainder = n % 10;
8 rev = rev * 10 + remainder;
9 n /= 10;
10 }
11 printf("Reversed number = %d", rev);
12 return 0;
13}
1#include <stdio.h>
2int main() {
3 int n, rev = 0, remainder;
4 printf("Enter an integer: ");
5 scanf("%d", &n);
6 while (n != 0) {
7 remainder = n % 10;
8 rev = rev * 10 + remainder;
9 n /= 10;
10 }
11 printf("Reversed number = %d", rev);
12 return 0;
13}
14
15
1#include <stdio.h>
2int main() {
3 int n, rev = 0, remainder;
4 printf("Enter an integer: ");
5 scanf("%d", &n);
6 while (n != 0) {
7 remainder = n % 10;
8 rev = rev * 10 + remainder;
9 n /= 10;
10 }
11 printf("Reversed number = %d", rev);
12 return 0;
13}
14