wap to input a number and display whether number is automorphic number or not please write in such a way so that is easy to understand . will mark u as a brainliest
Answers
Answered by
2
heya.....
tysm..#gozmit
In mathematics, an automorphic number is a number whose square "ends" in the same digits as the number itself.
For example, 52 = 25, 62 = 36, 762 = 5776, and 8906252 = 793212890625, so 5, 6, 76 and 890625 are all automorphic numbers
Input a number : 76 Automorphic Number.tysm..#gozmit
HarshitMestry123:
lol
Answered by
2
bluej
import java.util.*;
class Automorphic number
{
public static void main()
{
Scanner sc=new Scanner(System.in);
int n,d;
double sq;
System.out.println("Enter a number:");
n=sc.nextInt();
sq=n*n;
while(sq<0)
{
d=sq%10;
sq=sq/10;
if(d==n)
break;
else
System.out.println("Not an Automorphic number");
}
System.out.println("Automorphic number");
}
}
import java.util.*;
class Automorphic number
{
public static void main()
{
Scanner sc=new Scanner(System.in);
int n,d;
double sq;
System.out.println("Enter a number:");
n=sc.nextInt();
sq=n*n;
while(sq<0)
{
d=sq%10;
sq=sq/10;
if(d==n)
break;
else
System.out.println("Not an Automorphic number");
}
System.out.println("Automorphic number");
}
}
Similar questions