import java.io.DataInputStream;
import java.io.IOException;
public class percabangan2 {
public static void main(String[]args) throws IOException{
DataInputStream input=new DataInputStream(System.in);
int a,b,c,d;
System.out.print("Masukkan Nilai Pertama = ");
a=Integer.parseInt(input.readLine());
System.out.print("Masukkan Nilai Kedua = ");
b=Integer.parseInt(input.readLine());
System.out.print("Masukkan Nilai Ketiga = ");
c=Integer.parseInt(input.readLine());
System.out.print("Masukkan Nilai Keempat = ");
d=Integer.parseInt(input.readLine());
if (a>b){
if(a>c){
if (a>d){
System.out.println("Angka Terbesar = "+a);
}else{
System.out.println("Angka Terbesar = "+d);
}
}else{
if (c>d){
System.out.println("Angka Terbesar = "+c);
}else{
System.out.println("Angka Terbesar = "+d);
}
}
}else{
if (b>c){
if (b>d){
System.out.println("Angka Terbesar = "+b);
}else{
System.out.println("Angka Terbesar = "+d);
}
}else{
if (c>d){
System.out.println("Angka Terbesar = "+c);
}else{
System.out.println("Angka Terbesar = "+d);
}
}
}
}
}
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar