Sunday, 29 March 2015

Cara Menentukan Hari dengan C++











#include <iostream.h>
#include <conio.h>
#include <iomanip.h>

void main()
{

char huruf;
cout << "\n                    .::PROGRAM NAMA HARI::." <<endl;
cout << "===============================================================" <<endl;
cout << "\n A = Senin   |   B = Selasa   |   C = Rabu     |   D = Kamis ";
cout << "\n E = Jum'at  |   F = Sabtu    |   G = Minggu   |   " <<endl;
cout << "\n" <<endl;
cout << "---------------------------------------------------------------"<<endl;
cout<<"Pilih = ";
cin>>huruf;
if (huruf=='a' || huruf=='A')
cout<<"HARI SENIN";
else
if (huruf=='b' || huruf=='B')
cout<<"HARI SELASA";
else
if (huruf=='c' || huruf=='C')
cout<<"HARI RABU";
else
if (huruf=='d' || huruf=='D')
cout<<"HARI KAMIS";
else
if (huruf=='e' || huruf=='E')
cout<<"HARI JUM'AT";
else
if (huruf=='f' || huruf=='F')
cout<<"HARI SABTU";
else
if (huruf=='g' || huruf=='G')
cout<<"HARI MINGGU";
else
cout<<"MAAF KODE HARINYA SALAH";
}


0 comments:

Post a Comment