Why is this not working?

So I just started learning c++ and i just tried making a simple adding calculator. When I run it it says there is an unexpected ; before the int. What is wrong with the code?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
  #include <iostream>
using namespace std

int main()
{
    int x;
    int y;
  cout << "Type  in a number you want to be added!" << endl;
  cin >> x;
  cin.ignore()
  cout << "And another!" << endl;
  cin >> y;
  cin.ignore()
  int sum = x + y;
  cout << "The sum is" << sum << "!" << endl;
  return 0;
}
you are missing semi-colons on lines 2, 10 and 13.
closed account (yR9wb7Xj)
You do not need the cin.ignore atleast that's what I think. Anyways you are missing semicolon for using namespace std; and as well for your cin.ignore(); It should work fine.
You're missing three semicolons.

One after using namespace std and another after both of your (unnecessary) ignores
There are actually multiple errors:

1.) You forgot to put a semicolon at the end of using namespace std

2.) Oh, and 3.)
You forgot to put another semicolon after the two cin.ignore()
Thank you for the help
Topic archived. No new replies allowed.