import java.util.*;
class automorphic
{
public static void main(String Args[])
{
System.out.println("Enter a number");
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int d=digits(n);
if(n==((n*n)%Math.pow(10,d)))
{
System.out.println("The number is automorphic");
}
else
{
System.out.println("The number is not automorphic");
}
}
public static int digits(int a)
{
int k=0;
while(a>0)
{
a=a/10;
k++;
}
return(k);
}
}
0 Comments