#include<iostream>
using namespace std;
int reverse(int );
int main()
{
int num,k;
cout<<"Enter your number:";
cin>>k;
cout<<endl;
num=reverse(k);
cout<<"Reverse number is :"<<num;
return 0;
}
int reverse(int a)
{
int j,n,rev;
//reverse number logic
rev=0;
while(a>0)
{
j=a%10;
rev=rev*10+j;
a=a/10;
}
return rev;
}
using namespace std;
int reverse(int );
int main()
{
int num,k;
cout<<"Enter your number:";
cin>>k;
cout<<endl;
num=reverse(k);
cout<<"Reverse number is :"<<num;
return 0;
}
int reverse(int a)
{
int j,n,rev;
//reverse number logic
rev=0;
while(a>0)
{
j=a%10;
rev=rev*10+j;
a=a/10;
}
return rev;
}
No comments:
Post a Comment