Conditional Logic and Integer Division
What is printed when the following code segment is executed?
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);
A
Value is: 1
B
Value is: 2.3333333
C
Value is: 2
D
Value is: 21
Question Leaderboard
| Rank | |||||
|---|---|---|---|---|---|
| #1 | ngvandangthanh | 2 | 2 | - | 200 |
| #2 | liuwilliam072410 | 1 | 1 | 0m 28s | 72 |
| #3 | 1710289 | 1 | 1 | 0m 32s | 68 |
| #4 | 1716628 | 1 | 1 | 0m 55s | 45 |
Items per page:
10
1 – 4 of 4
