Sunday 15 March 2015

To check whether the person is in teen age or not Using C

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

void main()
{
int age ;
clrscr() ;
printf("Enter the age : ") ;
scanf("%d", &age) ;
if(age >= 13 && age <= 19)
printf("\nThe person is in teen age.") ;
else
printf("\nThe person is not in teen age.") ;
getch() ;
}

RUN 1 :
~~~~~~~
Enter the age : 16
The person is in teen age.
RUN 2 :
~~~~~~~
Enter the age : 21
The person is not in teen age.

No comments:

Post a Comment