-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNumberTypes.java
More file actions
42 lines (40 loc) · 873 Bytes
/
Copy pathNumberTypes.java
File metadata and controls
42 lines (40 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
34
35
36
37
38
39
40
41
42
import java.util.*;
class NumberTypes
{
public static void main(String args[])
{
int pcount=0;
int ncount=0;
int zcount=0;
//n=n/10;
Scanner sc=new Scanner(System.in);
int nol=1;
while(nol<=5)
{
int n=sc.nextInt();
if(n>0)
{
pcount=pcount+1;
//System.out.println("count of +ve numbers"+pcount);
nol++;
}
else if(n<0)
{
ncount=ncount+1;
//System.out.println("count of -ve numbers"+ncount);
nol++;
}
else{
zcount=zcount+1;
//k
//l;
// System.out.println("count of zero numbers"+zcount);
n++;
}
}
System.out.println("count of +ve numbers"+pcount);
System.out.println("count of -ve numbers"+ncount);
System.out.println("count of zero numbers"+zcount);
sc.close();
}
}