C program to check if person eligible for voting or not.
Solution:
In this program, accept an age of person from user. Check the condition for voting, i.e age >17 or age >=18. If this condition is true, then it prints message "person is eligible for voting".
Output:


Solution:
In this program, accept an age of person from user. Check the condition for voting, i.e age >17 or age >=18. If this condition is true, then it prints message "person is eligible for voting".
#include<stdio.h>
int main()
{
int age;
printf("Enter Age of Person : ");
scanf("%d",&age);
if(age>17)
printf("\nPerson is Eligible for Voting");
else
printf("\nPerson is NOT Eligible for Voting");
return 0;
}
Output:




