#### A number is said to be adam number if a number is squared and reversed and then its root is found out and again reversed and hence if the number obtained is same as the initial number then its is called an adam number.Adam numbers up to 1000 are: 0, 1, 2, 3, 11, 12, 13, 21, 22, 31, 101, 102, 103, 111, 112 , 113, 121, 122, 201, 202, 211, 212, 221, 301, 311.

``````import java.io.*;
{
static int rev(int num)
{
int rev=0;
while(num!=0)
{
int rem=num%10;
rev=rev*10+rem;
num=num/10;
}
return rev;
}

static int sq(int a)
{
int sq_a=a*a;
return sq_a;
}

{
int b_sq=sq(b); //square of real num
int rev_b=rev(b); //reverse of real num
int sq_rev=sq(rev_b); //square of reversed num
int rev_sq=rev(sq_rev); //reverse of the square of the reversed num
if(b_sq==rev_sq)
{
return true;
}
else
{
return false;
}
}

public static void main()throws IOException
{
System.out.println("ENTER THE RANGE");
System.out.println("ENTER LOWER LIMIT");
System.out.println("ENTER UPPER LIMIT");
int freq=0;
if(m<n)
{
for(int i=m;i<=n;i++)
{
{
System.out.print(i+"\t");
freq++;
}
}
System.out.println();
System.out.println("FREQUENCY OF ADAM INTEGERS IS: "+freq);  }
else
{
System.out.println("INVALID RANGE");
}
}
} ``````

Output:
ENTER THE RANGE
ENTER LOWER LIMIT
100
ENTER UPPER LIMIT
200