forked from AllenDowney/ThinkJavaCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathElse.java
More file actions
18 lines (16 loc) · 365 Bytes
/
Else.java
File metadata and controls
18 lines (16 loc) · 365 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
public class Else
{
public static void main(String[] args)
{
int hrs = 21;
if (hrs < 13)
{
System.out.println("Good morning: " + hrs);
} else if (hrs < 18)
{
System.out.println("Good afternoon: " + hrs);
}
else
System.out.println("Good evening: " + hrs);
}
}