Computer Science, asked by Aneesh777, 1 year ago

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


Aneesh777: please I want the program without using scanner

Answers

Answered by siddhartharao77
5

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!

Answered by kapilchavhan223
5

Explanation:

if(s == n) // Checking the original number to the summation.

{System.out.println("Neon number");}else.

{System.out.println("Neon number");}else.System.out.println("Not a Neon Number");

Similar questions