005-004-007
Age Restriction Check with Logical Operators
Medium
Problem Description
Age Restriction Check with Logical Operators
In this problem, you will create a program that reads an integer age from standard input and uses the && operator to simultaneously evaluate age >= 18 and age <= 65, then prints Status: Eligible if both conditions are met, or Status: Not eligible otherwise.
Learning Objectives:
- Use the logical AND operator (
&&) to combine multiple conditions - Understand short-circuit evaluation behavior of
&& - Apply the range-check pattern using
&&for numerical validation
Ready to Try Running Code?
Log in to access the code editor and execute your solutions for this problem.
Don't have an account?
Sign Up