#include
#include
main(){
cetak:
long int kode;
char hari[100];
printf("Masukkan Kode : ");scanf("%ld",&kode);
if(kode == 1){
strcpy(hari,"Senin");
} else if(kode == 2){
strcpy(hari,"Selasa");
} else if(kode == 3){
strcpy(hari,"Rabu");
} else if(kode == 4){
strcpy(hari,"Kamis");
} else if(kode == 5){
strcpy(hari,"Jumat");
} else if(kode == 6){
strcpy(hari,"Sabtu");
} else if(kode == 7){
strcpy(hari,"Minggu");
} else {
kode = 0;
strcpy(hari,"Tidak Ada");
}
printf("*===================================================*\n");
printf("Maka Kode %ld",kode);
printf(" dan Hari %s\n\n",hari);
goto cetak;
}
#include
main(){
cetak:
long int kode;
char hari[100];
printf("Masukkan Kode : ");scanf("%ld",&kode);
if(kode == 1){
strcpy(hari,"Senin");
} else if(kode == 2){
strcpy(hari,"Selasa");
} else if(kode == 3){
strcpy(hari,"Rabu");
} else if(kode == 4){
strcpy(hari,"Kamis");
} else if(kode == 5){
strcpy(hari,"Jumat");
} else if(kode == 6){
strcpy(hari,"Sabtu");
} else if(kode == 7){
strcpy(hari,"Minggu");
} else {
kode = 0;
strcpy(hari,"Tidak Ada");
}
printf("*===================================================*\n");
printf("Maka Kode %ld",kode);
printf(" dan Hari %s\n\n",hari);
goto cetak;
}
Screenshotnya :
0 komentar:
Posting Komentar