Boolean Expression Evaluation
What is the value of result after the following code segment is executed?
int a = 12;
int b = 5;
boolean result = (a % b == 2) || (a / b == 2) && (b * 2 > a);
A
true
B
false
C
An error occurs
D
result is undefined
Question Leaderboard
| Rank | |||||
|---|---|---|---|---|---|
| #1 | kazvin.tjakradinata | 2 | 3 | 0m 54s | 136 |
| #2 | sgarv2513 | 1 | 1 | 0m 00s | 100 |
| #3 | busemagngr | 1 | 1 | 0m 17s | 83 |
| #4 | psak12 | 1 | 1 | 0m 22s | 78 |
| #5 | namansoin000 | 1 | 1 | 0m 59s | 41 |
| #6 | y.seong2027 | 1 | 1 | 1m 35s | 5 |
| #7 | mahmoudjibrin08 | 0 | 1 | 0m 00s | -10 |
| #8 | geethasailaja | 1 | 1 | 2m 21s | -41 |
| #9 | suhanakochhar006 | 0 | 1 | 0m 58s | -68 |
| #10 | chunxiangxu.cxu | 0 | 1 | 2h 55m | -10,537 |
Items per page:
10
1 – 10 of 10
APFIVE