JAVA
java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/**
An automorphic number is one that is contained in the end of its square.
Like 5²=25 and the last digit is 25.
25²=625,
and it goes on.
Hope you like the code.
*/
import java.util.*;
public class automorphic
{
public static void main(String[] args)
{
Scanner in= new Scanner(System.in);
int m,n,a,d=0,e;
System.out.println("Enter any number");
n=in.nextInt();
a=n*n;
m=n;
while(m>0)
{
m/=10;
d++;
}
e=(int)(Math.pow(10,d));
if(a%e==n)
{
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run