005-001-009
If Statement: Age Verification System
Medium
Problem Description
If Statement: Age Verification System
Learning Objective: Execute conditional processing using if statements
Create a program to input age and determine if the person is an adult. Use if statements for conditional branching.
Input
Line 1: Age (integer)
Output
- If 18 or older: "Adult"
- If under 18: "Minor"
Examples
Example 1
Input:
20
Output:
Adult
Example 2
Input:
15
Output:
Minor
Example 3
Input:
18
Output:
Adult
Ready to Try Running Code?
Log in to access the code editor and execute your solutions for this problem.
Don't have an account?
