-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOPERATORTENARY.java
21 lines (20 loc) · 955 Bytes
/
OPERATORTENARY.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
public class OPERATORTENARY {
public static void main(String[] args) {
int makanan1,makanan2;
String jawaban;
makanan1= 40;
makanan2= 49;
jawaban = makanan1<makanan2 ? "bakso" : "pizza" ;
System.out.println("pilihan makanan favorit1 = " +jawaban);
jawaban = makanan1>makanan2 ? "bakso" : "pizza" ;
System.out.println("pilihan makanan favorit2 = " +jawaban);
jawaban = makanan1==makanan2 ? "bakso" : "pizza" ;
System.out.println("pilihan makanan favorit3 = " +jawaban);
jawaban = makanan1>=makanan2 ? "bakso" : "pizza" ;
System.out.println("pilihan makanan favorit4 = " +jawaban);
jawaban = makanan1<=makanan2 ? "bakso" : "pizza" ;
System.out.println("pilihan makanan favorit5 = " +jawaban);
jawaban = makanan1!=makanan2 ? "bakso" : "pizza" ;
System.out.println("pilihan makanan favorit5 = " +jawaban);
}
}