Saya akan menunjukkan bagaimana cara membuat kalkulator sederhana dengan menggunakan DevC++....
*) Pertama, buka aplikasi DevC++, kemudian klik file-->New-->Project-->Console application-->C++-->isi nama file-->OK
*)Selanjutnya masukkan coding seperti berikut
#include <cstdlib>
#include <iostream>
#include <math.h>
#include <cmath>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
int main(int argc, char** argv) {
float d,e,f,pilih;
kalkulator :
system("cls");
cout<<"======================================\n";
cout<<"==========kalkulator sederhana========\n";
cout<<"=========Delavega Widya Ningrum=======\n";
cout<<"======================================\n";
cout<<"Nilai A : ";cin>>d;
cout<<"Nilai B : ";cin>>e;
cout<<"======================================\n";
cout<<"'+' = Penjumlahan [1]"<<endl;
cout<<"'-' = Pengurangan [2]"<<endl;
cout<<"'*' = Perkalian [3]"<<endl;
cout<<"'/' = Pembagian [4]"<<endl;
cout<<"'^' = Perpangkatan [5]"<<endl;
cout<<"=====================================\n";
cout<<"Masukkan Operasi : ";cin>>pilih;
if (pilih==1){
f=d+e;
cout<<"Hasil Penjumlahan : "<<f<<endl;
}
if (pilih==2){
f=d-e;
cout<<"Hasil Pengurangan : "<<f<<endl;
}
if (pilih==3){
f=d*e;
cout<<"Hasil Perkalian : "<<f<<endl;
}
if (pilih==4){
f=d/e;
cout<<"Hasil Pembagian : "<<f<<endl;
}
if (pilih==5){
f=pow(d,e);
cout<<"Hasil Perpangkatan : "<<f<<endl;
}
cout<<"===================================\n";
cout<<"Mengulang [1]"<<endl;
cout<<"Keluar [2]"<<endl;
cout<<"===================================\n";
cout<<"Masukkan Pilihan : ";cin>>pilih;
if (pilih==1){
goto kalkulator;
}
if (pilih==2){
system("pause");
}
return 0;
}




