-->

Write a program to read age of person and find out the category among following according to age.

//Write a program to read age of person  and find out the category among following according to age.
//           category                                         age
//            child                                            0 to 12
//            teenage                                         13 to 19
//           adult life                                      20 to 30
//           mature life                                   31 to 50
//          old age                                         over 50

#include<stdio.h>
#include<conio.h>
void main()
{
float age_person;
printf("enter your age \n");
scanf("%f",&age_person);
if(age_person>=0 && age_person<=12)
    {
          printf("Your are child\n");
    }
elseif(age_person>12 && age_person<=19)
    {
          printf("Your are teenage\n");
    }
elseif(age_person>19 && age_person<=30)
    {
          printf("Your are in adult life\n");
    }    
elseif(age_person>30 && age_person<=50)
    {
          printf("Your are passing your mature life now\n");
    }
elseif(age_person>50)
    {
          printf("Your are now an old person\n");
    }
printf("thank you!!!!\n");
getch();
}

No comments:

Post a Comment