-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathExample4.java
More file actions
26 lines (22 loc) · 563 Bytes
/
Example4.java
File metadata and controls
26 lines (22 loc) · 563 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
public class Example4 {
// 1 - musbat
// -3 manfiy
// 0 na musbat na manfiy
public static void main(String[] args) {
int n = -2;
String text;
/*
if (n > 0) {
text = "musbat";
} else if (n == 0) {
text = "na musbat na manfiy";
} else {
text = "manfiy";
}
*/
// shartga mos qiymat tanlash
text = (n > 0) ? "musbat" : (n == 0)
? "na musbat na manfiy" : "manfiy";
System.out.println("Siz kiritgan son " + text);
}
}