003-002-011
Comparison Operators in if Statements
Easy
Problem Description
Comparison Operators in if Statements
In this problem, you will create a program that reads an integer age from standard input, checks it using comparison operators, and outputs "Adult" if 18 or older, or "Minor" if under 18.
Learning Objective: Understand how to use comparison operators as if statement conditions
Overview
Create a program that reads an age and outputs an appropriate message.
Input
- Integer
age(1 line)
Specifications
- If 18 or older, output
Age {age}: Adult - If under 18, output
Age {age}: Minor
Input/Output Examples
Input: 20
Output: Age 20: Adult
Input: 15
Output: Age 15: Minor
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