Problem in calculator program

I have been programming for a week, and I am working on a calculator program,
and the compiler always gives me a 'parse error'.

//The Math Processor; will do all four operations
//

#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;

int main (int nNumberofArgs, char* pszArgs[])
{
int userNum;
int userNum2;
int userOp;
cout << "Welcome to the Calculator." << endl;
cout << "Please enter first number:";
cin >> userNum;
cout << "Please enter operation, 1 for add, two for subtract, " << endl;
cout << "three for multiply, and four for divide. Keep in mind, " << endl;
cout << "if you enter a invalid number, your answer will be zero:";
cin >> userOp;
cout << "Please enter next number:";
cin >> userNum2;
int outputNum;
switch(userOp)

{
case 3: outputNum = userNum * userNum2;
break
case 1: outputNum = userNum + userNum2;
break;
case 4: outputNum = userNum / userNum2;
break;
case 2: outputNum = userNum - userNum2;
break;
default: outputNum = 0;
}

cout << "Your answer is: "
cout << outputNum << endl;
cout << "Thank You" << endl;
system ("pause");
return 0;
}
The compiler gives errors for a reason. They're for you to read them:
error: expected `;' before "case"
This means that there's something wrong in the line before. In this case, you forgot the semicolon after the break in the previous line.
error: expected `;' before "cout"
Again.
Last edited on
Thank you. It said 'parse error' not ; so I had no idea.
Hm? What compiler?
Topic archived. No new replies allowed.