Contoh Program C++ Switch Case Hari
Ini Contoh Programnya :
#include <iostream.h>
void main ()
{
int hari;
cout<<"================================="<<endl;
cout<<" HARI "<<endl;
cout<<"================================="<<endl;
cout<<"MASUKAN HARI PILIHAN ANDA = ";
cin>>hari;
switch (hari)
{
case 1 :
cout<<"Hari Senin";
break;
case 2 :
cout<<"Hari Selasa" ;
break;
case 3 :
cout<<"Hari Rabu" ;
break;
case 4 :
cout<<"Hari Kamis" ;
break;
case 5 :
cout<<"Hari Jumat" ;
break;
case 6 :
cout<<"Hari Sabtu" ;
break;
case 7 :
cout<<"Hari Minggu" ;
break;
default :
cout<<"ANDA SALAH INPUT" ;
}
}
Comments
Post a Comment