Easy calculator, confusing problem

Just took a couple of minutes at the start of class and was confused why it didn't work. It says the error is at the first "{", by the way

#include <iostream>

using namespace std;

int x;
{
cout <<"Pick a value for x"<<endl;
cin >> x
cout << "The value of x is " << x <<endl;

int y;
cout <<"Pick a value for y"<<endl;
cin >> y
cout << "The value of y is" << y <<endl;

cout <<"Variables\nx= "<<x<<" and y = "<<y<<endl;
cout << x << " times " << y << " is " <<x * y<<endl;
cout << x << " divided by " << y << " is " <<x / y<<endl;
cout << x << " plus " << y << " is " <<x + y<<endl;
cout << x << " minus " << y << " is " <<x - y<<endl;
return 0;
}
You are missing semicolons after your statements with cin. In the future, please use code tags.
http://www.cplusplus.com/articles/z13hAqkS/
That didn't work, it still says its an error no matter what
closed account (48T7M4Gy)
The main problem is always the hardest to fix, I think.
int main()
{
int x;
Thanks! that helped ^!
Topic archived. No new replies allowed.