This C++ program takes a 5-digit number as input from the user, separates each digit, and calculates the reverse by multiplying each digit by its place value and adding the results. It outputs the reverse of the input number.
Hybridoma Technology ( Production , Purification , and Application )
Sol9
1. #include <iostream>
using namespace std;
int main()
{
long num,a,b,c,d,e,rev;
cout<<"Enter a five digit number:-";
cin>>num;
a=num%10; b=num/10;
c=b%10; b=b/10;
d=b%10; b=b/10;
e=b%10; b=b/10;
rev=a*10000+c*1000+d*100+e*10+b*1;
cout<<"Reverse of number is:-"<<rev;
system("pause");
}