write a program to check whether the person is eligible to vote
Answers
Answered by
0
Explanation:
The person is only eligible to vote if he is above the age of 18 years or is exactly 18
Answered by
2
Answer:
import java.io.*;
import java.util.*;
class VoteEligibility
{
public static Scanner sc=new Scanner(System.in);
public static void main(String args[])
{
int age;
System.out.println("Enter your age");
age=sc.nextInt();
if (age>=18)
System.out.println("Eligible to vote");
else
System.out.println("Ineligible to vote");
}
}
Explanation:
Similar questions