It just says - 37 or 0. I want it to be able to calculate stuffCode:#include <iostream> using namespace std; int main() { int x; int a, b; cout << "welcome to the calculator" << endl; cout << "enter 1 for division, 2 for multiplication, 3 for addition and 4 for subtraction" << endl; cin >> x; int sum; if (x == 1) { sum = a / b; } if (x == 2) { sum = a * b; } if (x == 3) { sum = a + b; } if (x == 4) { sum = a - b; } cout << "enter a number" << endl; cin >> a; cout << "one more please" << endl; cin >> b; cout << "and your answer is!" << endl; cout << sum; return 0; }




Reply With Quote
