public class rtr {
public static void main(String args[])throws java.io.IOException {
int age;
System.out.print("Enter your age");
age = (int) System.in.read();
if(age >= 18) System.out.println("You are elligible for voting");
else System.out.println("You are not elligible for voting");
}
}
output:
Enter your age 12
You are elligible for voting
Aucun commentaire:
Enregistrer un commentaire