Automorphic

import java.io.*;
class Automorphic
{
public static void main() throws IOException
{
InputStreamReader x= new InputStreamReader(System.in);
BufferedReader y= new BufferedReader(x);
int i,n,num,sq,len;

System.out.println(“Enter a number”);
n=Integer.parseInt(y.readLine());
sq=n*n;

len=Integer.toString(n).length();
num=sq%(int)Math.pow(10,len);
if(n==num)
System.out.println(“Automorphic”);
else
System.out.println(“Not an automorphic”);
}
}

Advertisements