Calculator Problem

I am extremely new to c++ and, after spending a few evenings learning the basics, decided to try and code a basic calculator. I got the first part, addition down fairly easily, but am having trouble with subtraction. It isn't making the calculator subtract, but the if then statement that is giving me trouble. Here is my code:
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
#include <iostream>
using namespace std;
//Addition is done...Time to move on to subtraction!

int main ()
{
       int start;
       cout << "Do you want to: 1)Add 2)Subtract"<<endl;
       cin >> start;

       if (start == 1);
	   {
		   int x;
		   int y;
	       int z;
	       cout << "Add this number:"<<endl;
	       cin >> x;
	       cout << "To this number:"<<endl;
	       cin >> y;
	       z = (x + y);
	       cout << "Which equals:"<<z<<endl;
		   
	   }
	   else if (start ==2);
	   {
		   int x;
	       int y;
	       int z;
	       cout << "Subtract this number:"<<endl;
	       cin >> x;
	       cout << "From this number:"<< endl;
	       cin >> y;
	       z = (y - x);
	       cout << "Which equals:"<<z<<endl;
	   }
	   return 0;
}
. The problem seems to be in the "else if (start ==2);". It says "Error: Expected a statement." What does this mean?
I think it has to do with you putting semicolons after the if and else if parenthesis. Take out the semi colons in lines 11 and 24 and tell me if that fixes it.
yeah try removing the two semicolons. Then if it still doesn't work some sucky compilers expect an else statement if you have an else if statement...so if it still doesn't work try adding an else statement.
Topic archived. No new replies allowed.