Program to determine whether a person is eligible for vote or not

Write a program to determine whether a person is eligible for a vote or not.

C Program

#include <stdio.h>
int main()
{
    int age;
    printf("Enter your age : ");
    scanf("%d", &age);
    if (age >= 18)
    {
        printf("You are eligible for vote\n");
    }
    else
    {
        printf("You are not eligible for vote\n");
    }
    return 0;
}
Input:
Enter your age : 21

Output:

You are eligible for vote


No comments:

Post a Comment