Computer Science, asked by mohammedfaraz10, 2 months ago

write a program to check whether the person is eligible to vote​

Answers

Answered by shivam071841
0

Explanation:

The person is only eligible to vote if he is above the age of 18 years or is exactly 18

Answered by SR5798
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