write a program to find out the person is eligivle to vote or not.
Answers
Answered by
1
Answer:
A person can votes if age is greater than or equal to 18.
import java.util.Scanner;
public class VotingAge
{
public static void main(String[] args)
{
int age;
Scanner sc = new Scanner(System.in);
System.out.print("Enter your age=");
age = sc.nextInt();
if (age >= 18)
{
System.out.println("You are eligible for vote.");
}
else
{
System.out.println("You are not eligible for vote.");
}
}
}
Answered by
0
Explanation:
hope it helps you
it is given in my book
Attachments:
Similar questions