Skip to content

Sujal1201/if-else-if

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published