#include<stdio.h>
#include<conio.h>
void main()
{
int reverse(int);
int num,rnum,sq,rsq,rnumsq;
clrscr();
printf("Adam number between 10 and 100\n");
for(num=10;num<=100;num++)
{
rnum=reverse(num);
sq=num*num;
rnumsq=rnum*rnum;
rsq=reverse(rnumsq);
if (rsq==sq)
printf("%d\n",num);
}
getch();
}
int reverse(int n)
{
int r,rn=0;
while (n>0)
{
r=n%10;
rn=(rn*10)+r;
n=n/10;
}
return(rn);
}
No comments:
Post a Comment