Q:-Write a C program to check whether a user is eligible to vote or not.
We are going to write a program in c which can check if the candidate is eligible to vote or not. We can do this by using a simple if-else statement.
#include<stdio.h> #include<conio.h> void main() { int age; clrscr(); printf("Enter your age="); scanf("%d", &age); if (age >= 18) { printf("User is eligible to vote"); } else { printf("User is not eligible to vote"); } getch(); }