### Calculatron 2000

#include <iostream>
using namespace std;

int a;
int b;
int operation
int operation1;
int operation2;
int operation3;
int operation4;

int main()
{

cout << "Hello and welcome to the Calculatron 2000. If you have difficulty doing math, then this is the tool for you! Please input your math problem.";
cin >> a >> operation >> b;

if (operation = '+')
(a + b) = operation1;
if (operation = '*')
(a * b) = operation2;
if (operation = '/')
(a / b) = operation3;
if (operation = '=')
(a = b) = operation4;

}
{
return() 0; }

I have no idea what's wrong...then again I am new to C++.

 ``1234567891011121314151617181920212223242526`` ``````int a; int b; char operation; int main() { cout << "Hello and welcome to the Calculatron 2000. If you have difficulty doing math, then this is the tool for you! Please input your math problem." << endl; cin >> a >> operation >> b; int res = 0; if (operation == '+') res = (a + b); else if (operation == '*') res = (a * b); else if (operation == '/') res = (a / b); else if (operation == '-') res = (a - b); cout << res << endl; return 0; }``````
Topic archived. No new replies allowed.