Neon(9) (9*9=81) (8+1=9) Java program
Answers
Answered by
1
Answer:
Program:-
import java.util.*;
public class Neon
{
public static void main(String args[ ])
{
Scanner in=new Scanner(System.in);
int n,a=0,s=0,num=0;
System.out.println("Enter the number");
n=in.nextInt();
num=n;
n=n*n;
while(n!=0)
{
a=n%10;
s=s+a;
n=n/10;
}
if(s==num)
System.out.println("It is a neon number");
else
System.out.println("It is not a neon number");
}
}
Similar questions
Accountancy,
1 month ago
English,
1 month ago
Science,
1 month ago
History,
3 months ago
Social Sciences,
3 months ago
Hindi,
10 months ago