write a program to determine the reverse of a number using c++
Answers
Answered by
0
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
long n,rev=0,d;
cout<<"Enter the number:";
cin>>n;
while(n!=0)
{
d=n%10;
rev=(rev*10)+d;
n=n/10;
}
cout<<"The reversed number is "<<rev;
getch();
}
#include<conio.h>
void main()
{
clrscr();
long n,rev=0,d;
cout<<"Enter the number:";
cin>>n;
while(n!=0)
{
d=n%10;
rev=(rev*10)+d;
n=n/10;
}
cout<<"The reversed number is "<<rev;
getch();
}
Similar questions
English,
9 months ago
Hindi,
1 year ago
History,
1 year ago
Biology,
1 year ago
Social Sciences,
1 year ago