1.

Write a program in java to find whether the number is neon or not

Answer»

Neon number:

A neon is a number where the sum of digits of SQUARE of the number is equal to the number.

Sample PROGRAM of Neon number:

import java.util.*;

class Brainly

{

public static void main(String[] args)

{

int num1 = 9,num2,num3 = 0,num4;

num2 = num1 * num1;

while(num2!=0)

{

num4=num2%10;

num3 = num3 + num4;

num2 = num2/10;

}

if(num3 == num1)

{

System.out.println("Neon Number");

}

else

{

System.out.println("Not Neon Number");

}

}

}


Output:

Neon number.


Hope this HELPS!    ------ > Good luck!



Discussion

No Comment Found