#include
int main() {
int guess;
int tries = 0;
std::cout << “I have a number 1-10.\n”;
std::cout << "Please guess it: ";
std::cin >> guess;
// Write a while loop here:
while (guess != 8 && tries < 50) {
std::cout << "Wrong guess try again: ";
std::cin >> guess;
tries ++ 1;
}
if (guess == 8) {
std::cout << "You got it!\n";
}
}
Hi all this code os for a number guesser that Is a task in one of the lessons in the c++ Codecademy course. It gives me a pass but when I try and compile the program in the terminal it gives me the error of guess.cpp:19:14: error: expected ‘;’ before numeric constant
tries ++ 1;
^
This has also happened before on other tasks and even when I copy the code directly from the hint box it gives an error similar to this, always including an expected ; before something. Thanks