+ 1
Write a program to input age of a person and print message 'eligible to vote' if age is more than 18 otherwise print message 'n'
2 Answers
+ 2
import java.util.Scanner;
public class VoteEligible
{
public static void main(String args[])
{
Scanner scan = new Scanner(System.in);
int Age = scan.nextInt();
if(Age>18)
{
System.out.println("eligible to vote");
}
else
{
System.out.println("n");
}
}
}
+ 1
age = input()
if age > 18:
print("eligible to vote")
else:
print("n")