Write a program in C to show your age period.

Write a program in C to show your age period.

Write a program in C to show your age period.

/*
Author : Sabya Roy
*/

 

#include<stdio.h>
#include<conio.h>

main()
{
            int age;                                      //Initialization of variable
            printf(“Enter your age : “);
            scanf(“%d”, &age);                  //input age
            if(age<=0)
                        printf(“You have not borned yet!”);
            else if(age>0 && age<=12)
                        printf(“\nYou are a child.”);
            else if(age>12 && age<=19)
                        printf(“\nYou are a teen ager.”);
            else if(age>19 && age<=40)
                        printf(“\nYou are young.”);
            else
                        printf(“\nWish you long life.”);
            getch();
}

———————————————————————————————————————————————————-




Output :

Enter your age : 22
You are Young.

———————————————————————————————————————————————————-

Share this post

Leave a Reply

Your email address will not be published. Required fields are marked *