[Solved] C++ : Handling input
[ad_1] There is no need to check the value of d in the while condition if you have the break in each valid case: while (true) { cout << “1.Easy\n”; cout << “2.Medium\n”; cout << “3.Hard\n”; cout << “Choose your difficulty:”; cin >> d; if (d == ‘1’) { a.setdifficulty(“Easy”); break; } else if (d … Read more