I'm teaching myself C++ and have run into a problem in the basics. I'm trying to create a basic calculator that I can specify the first number then the second number then the type of math.
Here is my code for reference:
Well I'm getting a compile error on this like:Code:// // Mike's super awesome calculator // #include <cstdio> #include <cstdlib> #include <iostream> using namespace std; int main(int nNumberofArgs, char* pszArgs[]) { // Enter first number int first; cout << "Enter the first number:"; cin >> first; // Enter second number int second; cout << "Enter the second number:"; cin >> second; // Enter type int type; cout << "Enter the type:"; cin >> type; // Calculate answer int answer; answer = first type second; // Display answer cout << "The answer is:"; cout << answer << endl; // Wait for user system ("Pause"); return 0; }
Can anyone help me with this?Code:answer = first type second;
Move to tech if needed.
XI Wiki


