Java Tutorial
- Runtime
- java 21.0.12
- Files
- 60 files · 24 KB
- Runs
- 50 runs
- Published
package sessionSeven;import java.util.Scanner;public class IfElse { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int age = sc.nextInt(); System.out.println("Your age is : " + age); if (age >= 18) { System.out.println("You can vote"); } else { System.out.println("Wait " + (18 - age) + " more years"); } }}