-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprg13.java
More file actions
32 lines (31 loc) · 750 Bytes
/
prg13.java
File metadata and controls
32 lines (31 loc) · 750 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import java.util.Scanner;
public class prg13 {
static void checkNeon(int n1)
{
int s=n1;
int sqr=0,sum=0;
sqr=(int) Math.pow(s,2);
int result=sqr;
while(sqr!=0)
{
result=sqr%10;
sum+=result;
sqr/=10;
}
if(sum==s)
{
System.out.println("It is a Neon Number");
}
else{
System.out.println("Not a Neon Number");
}
}
public static void main(String[] args) {
int n1;
System.out.println("Enter a numebr to check whether it is a neon numebr or not:");
Scanner s = new Scanner(System.in);
n1=s.nextInt();
checkNeon(n1);
s.close();
}
}