Percobaan percabangan if-else
Percobaan percabangan if-else
public static void main(String[] args) {
int point;
point=3;
System.out.println("===================");
System.out.println("Nama : Hadi atmoko");
System.out.println("Point :"+ point);
if(point >= 3)
System.out.println(" Ket : dapat medali EMAS");
else if (point >= 2)
System.out.println("Ket : dapat medali PERAK");
else if (point >= 1)
System.out.println("Ket : dapat medali PERUNGGU");
else
System.out.println("Ket : tidak dapat medali");
System.out.println("===========================");
}
// TODO code application logic here
}
public static void main(String[] args) {
int point;
point=3;
System.out.println("===================");
System.out.println("Nama : Hadi atmoko");
System.out.println("Point :"+ point);
if(point >= 3)
System.out.println(" Ket : dapat medali EMAS");
else if (point >= 2)
System.out.println("Ket : dapat medali PERAK");
else if (point >= 1)
System.out.println("Ket : dapat medali PERUNGGU");
else
System.out.println("Ket : tidak dapat medali");
System.out.println("===========================");
}
// TODO code application logic here
}
0 komentar:
Posting Komentar