Couple of reasons for this.
0) You don't need a semicolon here:
int main();
1) Your curly bracket is in the wrong place:
int main();
myNumber == '2';
{
It should be immediately below the function declaration:
int main()
{
myNumber == '2';
2)
myNumber
is not defined, so it doesn't have any type that C++ can know. Try
int myNumber == '2';
3) "==" is a comparison operator, not an assignment, so even if you had declared it
myNumber
would be have no "real" value. Use "=" instead - that's the assignment operator.
4) '2' is a character, not an integer - you probably want to use numbers here.
5) '200' is not a character, it's three characters - so that won't compile either, and you can't compare that with a single character even if you wanted to.
6)
myNumber + 2;
Does nothing: it does not change any values in the program at all. Probably, you meant
myNumber += 2;
Or
myNumber = myNumber + 2;
7) What did you expect '2' plus 2 to give you? Would it still work if you had assigned '9' instead?
8) Indent your code! pick a style, and stuck to it - poor indentation makes code harder to read, and that means it's harder to get right.
So little code, so many errors! :laugh: