Thursday, 19 July 2018

Five digit Palindrome

===========================================================================
                                CODING



#include<conio.h>
#include<iostream.h>
#include<math.h>

void main()
{
clrscr();

int b,c,d,e,f;
long a,q,n;
cout<<"Enter any five digit number:- ";
cin>>a;
n=a;
b=a%10;
a=a/10;
c=a%10;
a=a/10;
d=a%10;
a=a/10;
e=a%10;
a=a/10;
f=a%10;
a=a/10;
q=(b*10000.0)+(c*1000.0)+(d*100.0)+(e*10.0)+f;
cout<<"\n The reverse number is:- "<<q;
if(n==q)
{cout<<"\n The no. and its reverse are equal";}
else
{
 cout<<"\n The no. and its reverse are unqual";}
getch();
}

===========================================================================


                                OUTPUT


No comments:

Post a Comment