forked from Gen-zAB/GENETIC_CAL-C
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCAL-C.cpp
42 lines (36 loc) · 936 Bytes
/
CAL-C.cpp
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
#include <iostream>
using namespace std;
int main()
{
int x = 1; //while loop variable
int a;
int b;
int ans;
char op;
cout << "**********WELCOME TO GENETIC CAL-C**********" << endl;
cout << "START CALCULATING \n\n";
while (x == 1) {
cout << "\nEnter Your Calculation" << endl;
cin >> a >> op >> b;
if (op == '+') {
ans = a + b;
cout << "The Sum is " << ans << endl;
}
if (op == '-') {
ans = a - b;
cout << "The Difference is " << ans << endl;
}
if (op == '*') {
ans = a * b;
cout << "The Product is " << ans << endl;
}
if (op == '/') {
ans = a / b;
cout << "The Quotient is " << ans << endl;
}
if (op == '%') {
ans = a * b / 100;
cout << "The Answer is " << ans << endl;
}
}
}