Sunday, 15 March 2015

Check whether the person is eligible to vote or not Using C

# include <stdio.h>
# include <conio.h>
void main()
{
int age ;
clrscr() ;
printf("Enter the age : ") ;
scanf("%d", &age) ;
if(age >= 18)
printf("\nThe person is eligible to vote.") ;
else
printf("\nThe person is not eligible to vote.") ;
getch() ;
}

RUN 1 :
~~~~~~~
Enter the age : 20
The person is eligible to vote.
RUN 2 :
~~~~~~~
Enter the age : 16
The person is not eligible to vote.

No comments:

Post a Comment