C++ Hari Sebelumnya

# 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 (){
 if (waktu==1){cout<<"  Minggu "<<endl; }
 if (waktu==2){cout<<" Senin "<<endl;  }
else if (waktu==3){cout<<" Selasa"<<endl; }
else if (waktu==4){cout<<" Rabu "<<endl;}
else if (waktu==5){cout<<" Kamis"<<endl; }
else if (waktu==6){cout<<" Jum'at "<<endl;}
else if (waktu==7){cout<<" Sabtu "<<endl; }
else if ((waktu<1)||(waktu>7)){cout<<" Maaf Tidak Bisa"<<endl;}
}
main(){
data();
cout<<" Masukan Angka: ";
cin>>waktu;
cout<<" Hari Sebelum Angka "<<waktu<<" Adalah"<<endl;
input();
getch();
}

0 Response to "C++ Hari Sebelumnya"

Posting Komentar