#include <stdio.h>
int main()
{
    int n;
    printf("Enter the age: \n");
    scanf("%d",&n);
    switch (n)
        {
        case 18:
            {printf("NOT ELIGIBLE FOR VOTING\n");
             break;}
        case 20:
            {printf("ELIGIBLE FOR VOTING\n");
             break;}
        default:
            {printf("enter correct age(only age 18 and age 20 are valid)\n");
             break;}
        }
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: