Boolean Expression and Integer Division
Consider the following code segment:
int x = 7;
int y = 3;
if ((x < 10) && (y < 0))
System.out.println("Value is: " + x * y);
else
System.out.println("Value is: " + x / y);
What is printed as a result of executing the code segment?
A
Value is: 0
B
Value is: 2
C
Value is: 21
D
Value is: 2.3333333
Question Leaderboard
| Rank | |||||
|---|---|---|---|---|---|
| #1 | lsj08030922 | 1 | 1 | 0m 00s | 100 |
| #2 | hadleysmith5 | 1 | 1 | 0m 00s | 100 |
| #3 | keithy.mcbeefy | 1 | 1 | 1m 12s | 28 |
Items per page:
10
1 – 3 of 3
APFIVE