Program to print adult for age 18, teenager for 13 to 18 and child for below 13.

//Program to print adult for age 18, teenager for 13 to 18 and child for below 13.

#include<stdio.h>

int main()

{
int age;
printf("enter age\n");
scanf("%d", &age);
if(age>18){
printf("you are Adult");
}
else if(age>=13 && age<=18){
printf("you are teenager");
}
else{
printf("you are child");
}
return 0;
}

Output :

enter age
16
you are teenager
--------------------------------
Process exited after 8.025 seconds with return value 0
Press any key to continue . . .

Comments

Popular posts from this blog

Write a program to check if a number is prime or not.

write a program (keep taking numbers as input from user until user enters an Odd number)

write a program to print all the odd numbers from 1 to 100.