+ 7
Write a java program to input a number and check whether it is an automorphic or not.
An automorphic number is a number which is contained in the last digit(s) of its square. For example : 25 The square of 25 is 625 and 25 is present as the last two digits. Therefore, 25 is an automorphic number.
5 odpowiedzi
+ 17
@Vansh
U just need to see length of number entered and divide n^2 by 100... having zeroes equal to length of number
+ 14
System.out.print(Math.pow(n,2)%100.0==n);
//i think u should start thinking by yourself now
+ 6
You can't divide every number by 100. The number can be 5. It is also an automorphic number.
+ 6
That's why, I am facing problem. I tried it.