Program to check eligibility for voting

Program to check eligibility for voting


#include<stdio.h>
void main()
{
int age;
printf("Enter your age: ");
scanf("%d",&age);
if (age>=18)
{
printf("Eligible for voting!!!");
}
else
{
printf("Not eligible for voting!!!");
}
}

Explaination:
Here we have inputted age of  user and checked whether it is greater than 18 or not.
If age is greater than or equal to 18 then user is eligible for voting else not eligible for voting.

Output:





No comments:

Post a Comment