# C C++ program to find reverse of digits of given number

## C C++ program to find reverse of digits of given number

C++ Language के बारे में अधिक जानने के लिए देखें—Brief Introduction of C++

Procedure Oriented Programming (POP) और Object Oriented Programming (OOP) में अंतर जानने के लिए देखें—POP vs OOP

Looping और iterative statements के बारे में और अधिक जानने के लिए देखें— Looping statements in C

### C program to find reverse of digits of given number

``````#include<stdio.h>
int main()
{
int num,rem,rev=0;
printf("Enter a number: ");
scanf("%d",&num);
while(num!=0)
{
rem=num%10;
rev=rev*10+rem;
num=num/10;
}
printf("Reverse of digits = %d",rev);
return 0;
}``````

### C++ program to find reverse of digits of given number

``````#include<iostream>
using namespace std;
int main()
{
int num,rem,rev=0;
cout<<"Enter a number: ";
cin>>num;
while(num!=0)
{
rem=num%10;
rev=rev*10+rem;
num=num/10;
}
cout<<"Reverse of digits = "<<rev;
return 0;
}``````

### Output of C C++ program to find reverse of digits of given number

```Enter a number: 639
Reverse of digits = 936```
```Enter a number: 1234
Reverse of digits = 4321```

### Other similar programs in C C++

Share it to: 