Initializing your_num in guess_the_number.cpp
1 files changed, 1 insertions(+), 1 deletions(-) M guess_the_number.cpp
M guess_the_number.cpp => guess_the_number.cpp +1 -1
@@ 15,7 15,7 @@ int main(int argc, char* argv[]) } srand(time(NULL)); - int secret_num = 1 + rand() % highest_num, your_num, attempts = 0; + int secret_num = 1 + rand() % highest_num, your_num = -1, attempts = 0; while (your_num != secret_num) { cout << "Enter the number: "; cin >> your_num;