USING IF ELSE STATEMENT

 USING IF ELSE STATEMENT

DETERMINATION WHO ARE ELIGIBLE TO VOTE !!



INPUT

#include <stdio.h>

int main()
{
    int age;
    printf("Enter your age\n"age);
    scanf("%d", &age);

    if (age >= 18)
    {
        printf("You can vote !");
    }

    else if (10 < age < 18)
    {
        printf("your age is between 10 to 18 so you can vote as minor");
    }

    else
    {
        printf("You cannot vote!");
    }

    return 0;
}


OUTPUT

Enter your age 6 You cannot vote!

Enter your age
16
your age is between 10 to 18 so you can vote as minor

Enter your age 18 You can vote !










Comments