Table of Contents

Reverse Number

Program to find the Reverse of the number in C language.
#include<stdio.h>
#include<conio.h>
void main()

{

int n, rev = 0, rem;

printf("Enter an number: ");
scanf("%d", &n);

while (n != 0) {
rem = n % 10;
rev = rev * 10 + rem;
n /= 10;
}

printf("Reversed number = %d", rev);

getch();
}
Output

Enter the number: 345

Reverse number = 543