Computer Science, asked by ahmadwajid290, 30 days ago

Q8.) Write a program to check whether a person is eligible to vote or not. If the person is not eligible
to vote find out how many years he has to wait.​

Answers

Answered by Anonymous
4

[Question is being solved using python language]

n = int(input ("Enter your age : "))

if n>=18:

print ("You can vote")

elif n<18:

print (f"You can't vote now,You will be able to vote after {18-n} years ")

Explanation :-

  • Firstly take input of the age from the user using input function and typecast it into integer form.

  • Now using if else statements print the msg accordingly.

Output attached . . .

Attachments:
Similar questions