#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{
clrscr();
int r,p,m,b,n,rev,a,c,i,z;
r=0;
rev=0;
cout<<"Enter any number between 10 and 100: ";
cin>>z;
n=z;
c=n*n;
while(n!=0)
{
m=n%10;
r=r*10+m;
n=n/10;
}
cout<<"\n"<<"The square of "<<z<<"is "<<c;
cout<<"\n"<<"The reverse of "<<z<<"is "<<r;
p=r*r;
cout<<"\n"<<"The square of "<<r<<"is "<<p;
while(c!=0)
{
a=c%10;
rev=rev*10+a;
c=c/10;
}
if(rev==p)
cout<<"\n"<<z<<" is an Adam Number";
else
cout<<"\n"<<z<<" is not an Adam Number";
getch();
}
#include<conio.h>
#include<math.h>
void main()
{
clrscr();
int r,p,m,b,n,rev,a,c,i,z;
r=0;
rev=0;
cout<<"Enter any number between 10 and 100: ";
cin>>z;
n=z;
c=n*n;
while(n!=0)
{
m=n%10;
r=r*10+m;
n=n/10;
}
cout<<"\n"<<"The square of "<<z<<"is "<<c;
cout<<"\n"<<"The reverse of "<<z<<"is "<<r;
p=r*r;
cout<<"\n"<<"The square of "<<r<<"is "<<p;
while(c!=0)
{
a=c%10;
rev=rev*10+a;
c=c/10;
}
if(rev==p)
cout<<"\n"<<z<<" is an Adam Number";
else
cout<<"\n"<<z<<" is not an Adam Number";
getch();
}
ReplyDeletenice article for beginners.thank you.
javacodegeeks
welookups