kalkulator sederhana
"kalkulator sederhana"
#include <iostream>
using namespace std;
main ()
{
int a, b, c, d;
int e, f, g, h;
// operasi penjumlahan
cout<<"\n\"OPERASI PENJUMLAHAN\" "<<endl;
cout<<"\nMasukan Nilai a = ";
cin>>a;
cout<<"Masukan Nilai b = ";
cin>>b;
cout<<"Hasil = ";
cout<<a+b;
cout<<"\n";
cout<<"\n";
// operasi pengurangan
cout<<"\n\"OPERASI PENGURANGAN\" "<<endl;
cout<<"\nMasukan Nilai c = ";
cin>>c;
cout<<"Masukan Nilai d = ";
cin>>d;
cout<<"Hasil = ";
cout<<c-d;
cout<<"\n";
cout<<"\n";
//operasi pembagian
cout<<"\n\"OPERASI PEMBAGIAN\" "<<endl;
cout<<"\nMasukan Nilai e = ";
cin>>e;
cout<<"Masukan Nilai f = ";
cin>>f;
cout<<"Hasil = ";
cout<<e/f;
cout<<"\n";
cout<<"\n";
//operasi perkalian
cout<<"\n\"OPERASI PERKALIAN\" "<<endl;
cout<<"\nMasukan Nilai g = ";
cin>>g;
cout<<"Masukan Nilai h = ";
cin>>h;
cout<<"Hasil = ";
cout<<g*h;
cout<<"\n";
cout<<"\n";
}
#include <iostream>
using namespace std;
main ()
{
int a, b, c, d;
int e, f, g, h;
// operasi penjumlahan
cout<<"\n\"OPERASI PENJUMLAHAN\" "<<endl;
cout<<"\nMasukan Nilai a = ";
cin>>a;
cout<<"Masukan Nilai b = ";
cin>>b;
cout<<"Hasil = ";
cout<<a+b;
cout<<"\n";
cout<<"\n";
// operasi pengurangan
cout<<"\n\"OPERASI PENGURANGAN\" "<<endl;
cout<<"\nMasukan Nilai c = ";
cin>>c;
cout<<"Masukan Nilai d = ";
cin>>d;
cout<<"Hasil = ";
cout<<c-d;
cout<<"\n";
cout<<"\n";
//operasi pembagian
cout<<"\n\"OPERASI PEMBAGIAN\" "<<endl;
cout<<"\nMasukan Nilai e = ";
cin>>e;
cout<<"Masukan Nilai f = ";
cin>>f;
cout<<"Hasil = ";
cout<<e/f;
cout<<"\n";
cout<<"\n";
//operasi perkalian
cout<<"\n\"OPERASI PERKALIAN\" "<<endl;
cout<<"\nMasukan Nilai g = ";
cin>>g;
cout<<"Masukan Nilai h = ";
cin>>h;
cout<<"Hasil = ";
cout<<g*h;
cout<<"\n";
cout<<"\n";
}
Komentar
Posting Komentar