#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
int pilihan;
float a,b,hasil;
cout<<"Ini Adalah Program Kalkulator Sederhana"<<endl;
cout<<"1.Perkalian"<<endl;
cout<<"2.Pembagian"<<endl;
cout<<"3.Penjumlahan"<<endl;
cout<<"4.Pengurangan"<<endl;
cout<<"Pilih Jenis Operasi Penghitungan (1,2,3,4)"<<endl;
cin>>pilihan;
cout<<endl;
cout<<"+++++++++++++++++++++++++++++++"<<endl;
cout<<endl;
cout<<"Masukan Angka Pertama"<<endl;
cin>>a;
cout<<"Masuan Angka Ke Dua"<<endl;
cin>>b;
switch(pilihan)
{
case 1 :{hasil=a*b;cout<<hasil<<endl;}
break;
case 2 :{hasil=a/b;cout<<hasil<<endl;}
break;
case 3 :{hasil=a+b;cout<<hasil<<endl;}
break;
case 4 :{hasil=a-b;cout<<hasil<<endl;}
break;
default : cout<<"Maaf Pilihan Anda Tidak Tersedia :D";
}
system("pause");
return 0;
}
Sabtu, 29 September 2012
Program Kalkulator Sederhana
Langganan:
Posting Komentar (Atom)
0 komentar:
Posting Komentar