You need to use
==
to check whether numbers are equal, and a semi colon after an if makes it pointless. You should also always use curly braces, even though they are not mandatory, the often make problems with if clearer, especially if you are using a code formatting plugin as they will pick things like this up. Lines 17 to 19 should look like this:
1 2 3 4 5
|
if( a == 20) {
cout << "Correct" << "\n";
} else if ( a < 20 ) {
cout << "Incorrect" << "\n";
}
|
Although, I would question the logic in this program.
You enter a number
The program prints it doubled
The program prints it halved
The program asks for a two digit number (not specifying that it should be 20)
It then says you are wrong if you put less than 20, says you are right if you put 20, and ignores you if you put more than 20.
Is that what it's meant to do?