- Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathage.java
More file actions
Latest commit
15 lines (15 loc) · 464 Bytes
/
Copy pathage.java
File metadata and controls
15 lines (15 loc) · 464 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//this program prints you are adult or not using condition
importjava.util.*;
publicclassage {
publicstaticvoidmain(String[] args) {
Scannersc = newScanner(System.in);
System.out.println("Enter Your age:");
intage= sc.nextInt();
if(age>18){
System.out.println("You are an adult");
}else{
System.out.println("You are a teenager");
sc.close();
}
}
}