-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMultiCalc.cpp
More file actions
49 lines (46 loc) · 987 Bytes
/
MultiCalc.cpp
File metadata and controls
49 lines (46 loc) · 987 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include <iostream>
using namespace std;
int main()
{
float x,y,z;
cout << "Masukan angka pertama:";
cin >> x;
cout << "Masukan angka kedua :";
cin >> y;
cout << " \n";
cout << "Pilih mode kalkulator" << endl;
cout << "1: Penjumlahan" << endl;
cout << "2: Pengurangan" << endl;
cout << "3: Perkalian" << endl;
cout << "4: Pembagian" << endl;
cout << "Mode ";
cin >> z;
cout << " \n";
if(z==1)
{
float plus=x+y;
cout << "Hasil=" << plus;
}
else
{
if(z==2)
{
float minus=x-y;
cout << "Hasil=" << minus;
}
else
{
if(z==3)
{
float ply=x*y;
cout << "Hasil=" << ply;
}
else
{
float div=x/y;
cout << "Hasil=" << div;
}
}
}
return 0;
}