Computer Science, asked by ankita3998, 5 months ago

Write a program in Java to print 'n' terms of 'Automorphic' numbers entered by
the users. How many Automorphic numbers are to be displayed?
Enter number of termsAutomorphic numbers are:6
1
5
6
25
76
376


Answers

Answered by guptakriti598
0

Answer:

import java .until.Scanner;

Class Atomorphic

{

public static void main ()

{

Scanner sc = new Scanner (System.in);

int x=1,n,a=0;

System.out.pln(" Enter the number")

n=sc.nextInt();

x=n*n;

while(n>0)

{

if(n%10!=x%10)

{

a=1;

break;

}

n=n/10;

x=x/10;

}

if (a==0)

System.out.plm("Atomorphic number");

else

System.out.pln(" Not Atomorphic number");

}

}

Similar questions