Skip to content

Latest commit

 

History

History
36 lines (22 loc) · 997 Bytes

README.md

File metadata and controls

36 lines (22 loc) · 997 Bytes

if-else-if

Gender and Age Voting Eligibility Checker

This C program checks whether a person of a given gender and age is eligible to vote.

How to Use

  1. Compile: Compile the program using a C compiler. For example, you can use gcc on Linux or MinGW on Windows:

    gcc main.c -o voting_eligibility_checker
    
  2. Run: Run the compiled program:

    ./voting_eligibility_checker
    
  3. Input: Follow the prompts to enter the gender (M/F) and age of the person.

  4. Output: The program will then display whether the person is eligible to vote or not based on their gender and age.

Usage Example

Enter gender (M/F): M Enter age: 25

Men are eligible to vote.

Notes

  • The program accepts 'M' or 'm' for male gender and 'F' or 'f' for female gender.
  • The voting eligibility age is set to 18.
  • Invalid inputs for gender or age will result in appropriate error messages.

Feel free to use and modify this program according to your needs!