#include
#include
#include
void main()
{
int n,temp;
char ch;
clrscr();
do
{
printf("\nEnter the number:");
flushall();
scanf("%d",&n);
temp=n*n;
temp=rev(temp);
temp=sqrt(temp);
temp=rev(temp);
if(temp==n)
printf("the given number %d is adams number",n);
else
printf("The given number %d is not adams number",n);
printf("\nDo you want to continue(Y/N)");
flushall();
scanf("%c",&ch);
if(ch=='Y'||ch=='y')
continue;
else
break;
}while(1);
getch();
}
int rev(int x)
{
int n,tot=0;
n=x;
while(n!=0)
{
x=n%10;
tot=tot*10+x;
n=n/10;
}
return(tot);
}
No comments:
Post a Comment