C++ Fungsi Hari Selanjutnya

# include <iostream>
# include <conio>
int waktu;
void data (){
cout<<" NO. Hari     "<<endl;
cout<<" 1.     Senin "<<endl;
cout<<" 2.     Selasa   "<<endl;
cout<<" 3.     Rabu     "<<endl;
cout<<" 4.     Kamis    "<<endl;
cout<<" 5.     Jum'at   "<<endl;
cout<<" 6.     Sabtu    "<<endl;
cout<<" 7.     Minggu   "<<endl;
}
void input(){
cout<<" Masukan Angka: ";
cin>>waktu;
}
void pilih(){
 if (waktu==1){cout<<" Selasa"<<endl; }
else if (waktu==2){cout<<" Rabu"<<endl;  }
else if (waktu==3){cout<<" Kamis"<<endl; }
else if (waktu==4){cout<<" Jum'at"<<endl;}
else if (waktu==5){cout<<" Sabtu"<<endl; }
else if (waktu==6){cout<<" Minggu"<<endl;}
else if (waktu==7){cout<<" Senin"<<endl; }
else if ((waktu<1)||(waktu>7)){cout<<" Maaf Tidak Bisa"<<endl;}
}

main(){
data();
input();
cout<<" Hari Setelah Angka "<<waktu<<" Adalah"<<endl;
pilih();
getch();
}

0 Response to "C++ Fungsi Hari Selanjutnya"

Posting Komentar