#include<conio.h>
#include<iostream.h>
void main()
{
clrscr();
int N ,a,rev=0;
cout<<"Enter The Number: " ;
cin>>N;
int temp;
temp=N;
while(temp>=1)
{
a=temp%10;
rev=rev*10+a;
temp=temp/10;
}
cout<< "The Reverse Number is : "<<rev<<"\n" ;
if(N==rev)
{
cout<<"The Number is Palindrome ";
}
else
{
cout<<"The Number is not Palindrome";
}
getch();
}
#include<iostream.h>
void main()
{
clrscr();
int N ,a,rev=0;
cout<<"Enter The Number: " ;
cin>>N;
int temp;
temp=N;
while(temp>=1)
{
a=temp%10;
rev=rev*10+a;
temp=temp/10;
}
cout<< "The Reverse Number is : "<<rev<<"\n" ;
if(N==rev)
{
cout<<"The Number is Palindrome ";
}
else
{
cout<<"The Number is not Palindrome";
}
getch();
}
No comments:
Post a Comment