OneCompiler

ELIGIBLITY TO VOTE

177
import java.util.Scanner;

 public class Subtraction {
   
 public static void main(String[] args) { 
  
  // TODO Auto-Generated meathod stub 
  
  Scanner input = new Scanner(System.in);
  
 
System.out.println("ENTER YEAR OF BIRTH");

int yearofbirth = input.nextInt();


int Subtraction = 2020 - yearofbirth ;


if (Subtraction >= 18) {

System.out.println("YOU ARE ELIGIBLE TO VOTE");
}
if (Subtraction < 18) {

System.out.println("USER IS NOT ELIGIBLE TO VOTE");
}
}

}