Program to print eligibility to vote In C: In this post we will use if else statement to check whether the user is eligible to vote or not.
Code For Program to print eligibility to vote In C
#include<stdio.h>
#include<conio.h>
int main()
{
int age;
printf("Enter age:");
scanf("%d", &age);
if(age>=18)
printf("You can eligible for vote!");
else
printf("You cannot eligible for vote");
return 0;
}
Output:
Enter age:20
You can eligible for vote!
Enter age:15
You cannot eligible for vote!
Read: Program to print the number of days in a month using switch statements