10th Jun 2019, 12:53 PM
Harshit Panwar
3 Answers
+ 11
#include <iostream> using namespace std; int main() { int age; cin >> age; if (age <= 16 && age >= 0) { cout << "Too young"; } else if (age >= 18 && age <= 80) { cout << "Adult"; } else if (age >= 80 && age <= 100) { cout << "Senior"; } else { cerr << "ERROR!" << endl; } cout << endl; return 0; }
10th Jun 2019, 12:56 PM
Valen.H. ~
Valen.H. ~ - avatar
+ 3
Thanks every one
10th Jun 2019, 1:01 PM
Harshit Panwar
+ 2
If age = 80, the output is "AdultSenior" And if age = 17 , the output is "".
10th Jun 2019, 1:02 PM
Maxim Balakirev
Maxim Balakirev - avatar