└── Neon Number.java /Neon Number.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | 3 | public class NeonNumber { 4 | public static void main(String[] args) { 5 | Scanner scanner = new Scanner(System.in); 6 | 7 | // Input the number 8 | System.out.print("Enter a number: "); 9 | int number = scanner.nextInt(); 10 | 11 | // Calculate the square of the number 12 | int square = number * number; 13 | 14 | // Calculate the sum of digits of the square 15 | int sumOfDigits = 0; 16 | while (square > 0) { 17 | sumOfDigits += square % 10; 18 | square /= 10; 19 | } 20 | 21 | // Check if the number is a Neon Number 22 | if (sumOfDigits == number) { 23 | System.out.println(number + " is a Neon Number."); 24 | } else { 25 | System.out.println(number + " is not a Neon Number."); 26 | } 27 | 28 | scanner.close(); 29 | } 30 | } 31 | --------------------------------------------------------------------------------