-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTech_Number.java
More file actions
33 lines (32 loc) · 873 Bytes
/
Copy pathTech_Number.java
File metadata and controls
33 lines (32 loc) · 873 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
33
import java.util.*;
import java.lang.Math;
public class Tech_Number {
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
System.out.println("Enter the number: ");
int x=sc.nextInt();
int s,ls,rs,c=0,n1=x;
while(n1>0){
c++;
n1=n1/10;
}
if(c%2!=0){
System.out.println("The number is not a Tech Number");
return;
}
else{
ls=x/100;
rs=x%100;
s=ls+rs;
int p;
//int b=2;
p=(int)Math.pow(s,2);
if(p==x){
System.out.println("The number is a Tech Number");
}
else{
System.out.println("The number is not a Tech Number");
}
}
}
}