QUESTION DESCRIPTION :
In a country named Differenzia the minors and senior citizens are not eligible to vote. Only people aged between 18 to 60 (both inclusive) are eligible to vote. Write a program to determine a person in Differenzia is eligible to vote.
TEST CASE 1
INPUT
18
OUTPUT
Eligible
TEST CASE 2
INPUT
2
OUTPUT
Not Eligible
EXPLANATION :
In a country named Differenzia the minors and senior citizens are not eligible to vote. Only people aged between 18 to 60 (both inclusive) are eligible to vote. Write a program to determine a person in Differenzia is eligible to vote.
TEST CASE 1
INPUT
18
OUTPUT
Eligible
TEST CASE 2
INPUT
2
OUTPUT
Not Eligible
EXPLANATION :
The problem is a basic if else ( if else statements ) problem , that requires you to check weather the person who is going to vote is eligible to vote or not. The input is the age of a person and you have to check weather the age is between 18-60 , if yes , the person is eligible , else he is not.
ALGORITHM :
- Take input from the user ( a )
- Check the input satisfies the eligibility criteria or not ( a>=18 && a<=60 )
- If yes , print Eligible
- Otherwise print Not Eligible
No comments:
Post a Comment