Sabtu, 17 April 2010

Cpp ifn

#include

int main(){

int hari = 5;

if(hari == 1){

// proses
printf("hari senin");

}
else if(hari == 2){

// proses
printf("hari selasa");

}
else if(hari == 3){

// proses
printf("hari rabu");

}
else if(hari == 4){

// proses
printf("hari kamis");

}
else if(hari == 5){

// proses
printf("hari jumat");

}
else if(hari == 6){

// proses
printf("hari sabtu");

}
else if(hari == 7){

// proses
printf("hari minggu");

}
else{

// proses
printf("tidak ada hari ke : %d\n", hari);

}

return 0;

}