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
result is undefined
B
An error occurs
C
false
D
true
Question Leaderboard
| Rank | |||||
|---|---|---|---|---|---|
| #1 | busemagngr | 2 | 2 | 0m 42s | 158 |
| #2 | kazvin.tjakradinata | 2 | 3 | 0m 54s | 136 |
| #3 | sgarv2513 | 1 | 1 | 0m 00s | 100 |
| #4 | Potter16 | 1 | 1 | 0m 12s | 88 |
| #5 | psak12 | 1 | 1 | 0m 22s | 78 |
| #6 | charliecao121159 | 1 | 1 | 0m 48s | 52 |
| #7 | namansoin000 | 1 | 1 | 0m 59s | 41 |
| #8 | y.seong2027 | 1 | 1 | 1m 35s | 5 |
| #9 | mahmoudjibrin08 | 0 | 1 | 0m 00s | -10 |
| #10 | austinwang0823 | 0 | 1 | 0m 04s | -14 |
Items per page:
10
1 – 10 of 14
