JAVA
java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import java.util.Scanner;
public class Voting
{
public static void main(String[] args) {
/*Enter age from range 1 to 104*/
Scanner sc = new Scanner(System.in);
int age = sc.nextInt();
System.out.println("Ur age is "+age+".");
if (age > 0 && age <= 12){
System.out.println("Why r u even here ? U can't vote");}
else if (age > 12 && age < 16){
System.out.println("U still have some time left.");}
else if (age > 16 && age <=104){
System.out.println("U can vote.");
}else{
System.out.println("Error.");
}
}
}
Enter to Rename, Shift+Enter to Preview
OUTPUT
Запуск