22 lines
409 B
C
22 lines
409 B
C
#include <stdio.h>
|
|
|
|
int main() {
|
|
int age;
|
|
|
|
printf("Enter your age: ");
|
|
scanf("%d", &age);
|
|
|
|
// c only matches one branch so don't need to specify lower limits of each age range
|
|
if ( age <= 0 ) {
|
|
printf("Still a baby\n");
|
|
} else if ( age <= 12 ) {
|
|
printf("The junior years\n");
|
|
} else if ( age < 20 ) {
|
|
printf("Teenage years\n");
|
|
} else {
|
|
printf("Downhill all the way now!\n");
|
|
}
|
|
|
|
return 0;
|
|
}
|