Else-if ladder
📖 Scenario: You are creating a simple program that categorizes a person's age group based on their age.
🎯 Goal: Build a program that uses an else-if ladder to print the correct age group for a given age.
📋 What You'll Learn
Create an integer variable called
age with the value 25Create an
else-if ladder to check the age and assign the correct age groupUse these age groups: Child (0-12), Teen (13-19), Adult (20-59), Senior (60 and above)
Print the age group using
printf💡 Why This Matters
🌍 Real World
Programs often need to make decisions based on ranges, like categorizing ages, prices, or scores.
💼 Career
Understanding <code>else-if</code> ladders is essential for writing clear decision-making code in many software jobs.
Progress0 / 4 steps