This program checks if a number entered is a Neon Number or not, in JAVA.
A number is said to be a Neon Number if the sum of digits of the square of the number is equal to the number itself.
Example- 9 is a Neon Number. 9*9=81 and 8+1=9.Hence it is a Neon Number.
public class NeonNumber
public static void main(String args)
Scanner ob=new Scanner(System.in);
System.out.println("Enter the number to be checked.");
while(square!=0)//Loop to find the sum of digits.
System.out.println(num+" is a Neon Number.");
System.out.println(num+" is not a Neon Number.");
The number is entered through Scanner class and then its square is taken by multiplying the number 2 times.After that we find the sum of digits of the square and check if the number is equal to the sum of digits of square of the number.