Minggu, 18 April 2010

Java ifn

class Ifn{

public static void main(String[] args){
int hari = 5;

if(hari == 1){

// proses
System.out.println("hari senin");

}
else if(hari == 2){

// proses
System.out.println ("hari selasa");
}
else if(hari == 3){

// proses
System.out.println ("hari rabu");

}
else if(hari == 4){

// proses
System.out.println ("hari kamis");

}
else if(hari == 5){

// proses
System.out.println ("hari jumat");

}
else if(hari == 6){

// proses
System.out.println ("hari sabtu");

}
else if(hari == 7){

// proses
System.out.println ("hari minggu");
}
else{

// proses
System.out.println("tidak ada hari ke : " + hari);
}
}
}