Coding Now – Best AI & Full Stack Courses in Delhi NCR | 100% Placement
Limited Offer: Get 50% OFF on AI & Full Stack Courses
📞 Call Now: +91 9667708830
Home Community WAC (Write a C Program) to accept the age of a person from …

WAC (Write a C Program) to accept the age of a person from the user and display the age category using if-else if statements according to the following criteria: 1–5 years: Baby 6–13 years: Child 14–18 years: Teen 19–60 years: Adult Above 60 years:

Soham  •  Jul 17, 2026  •  2 views
1–5 years: Baby
6–13 years: Child
14–18 years: Teen
19–60 years: Adult
Above 60 years: Senior Citizen
0

1 Answers

Soham
Jul 17, 2026
#include <stdio.h>

int main()
{
int age;

printf("Enter your age: ");
scanf("%d", &age);

if (age >= 1 && age <= 5)
{
printf("Baby");
}
else if (age >= 6 && age <= 13)
{
printf("Child");
}
else if (age >= 14 && age <= 18)
{
printf("Teen");
}
else if (age >= 19 && age <= 60)
{
printf("Adult");
}
else if (age > 60)
{
printf("Senior Citizen");
}
else
{
printf("Invalid Age");
}

return 0;
}

Your Answer

Will not be displayed publicly
💬 Talk to Advisor
1
WhatsApp

Latest from Our Blog

Insights on AI, Data Science, Full Stack & Career

View All Articles →