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" ;
}
}
Ini Contoh Outpunya :

Comments

Popular posts from this blog

Contoh Program C++ Perpustakaan

Contoh Program C++ Menghitung Nilai Akhir Mahasiswa

Contoh Program C++ Array Dimensi 2 Matriks Ordo 2x3 dengan 2x3