A neon number is a number where the sum of digits of square of the number is equal to the number. For example, if the input number is 9, its square is 9*9 = 81 and the sum of the digits is 9. i.e. 9 is a neon.
In this program, you are going to learn that how to check a given number is neon or not.
Steps to check a given number is neon or not
1. Calculate the square of the given number.
2. Add each digit of the calculated square number.
3. compare the sum of digits of square of the number and number.
4. If the sum of digits equal to the number, then it is a neon otherwise it is not neon.
Output:
Enter the number = 9
neon number
need an explanation for this answer? contact us directly to get an explanation for this answer