-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathif5.java
More file actions
26 lines (23 loc) · 719 Bytes
/
if5.java
File metadata and controls
26 lines (23 loc) · 719 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
package ifdirect;
import java.util.Scanner;
public class if5 {
public static void main(String[] args) {
int a, b, c, count = 0;
Scanner scanner = new Scanner(System.in);
System.out.println("1-son:");
a = scanner.nextInt();
System.out.println("2-son:");
b = scanner.nextInt();
System.out.println("3-son:");
c = scanner.nextInt();
if (a >= 0) count++;
if (b >= 0) count++;
if (c >= 0) count++;
int counts = 0;
if (a<0) counts++;
if (b<0) counts++;
if (c<0) counts++;
System.out.printf("Musbatlar soni: %d\n", count);
System.out.printf("Manfiylar soni: %d", counts);
}
}