Simply insert this condition:
if (userAge >= 18 && userAge <= 25) {
Ex: 17 prints "Ineligible", 18 prints "Eligible".
#include
using namespace std;
int main() {
int userAge;
cin >> userAge;
if (/* Your solution goes here */) {
cout << "Eligible" << endl;
}
else {
cout << "Ineligible" << endl;
}
return 0;
}
Simply insert this condition:
if (userAge >= 18 && userAge <= 25) {