For <code>double d = 5; int x = (int) d / 2;</code>, x equals
- Acheck_circle
2
- B
2.5
- C
Compile error
- D
3
Explanation
Cast applies first to d → 5; then 5/2 (int division) = 2.
AP Computer Science A· difficulty 4/5
For <code>double d = 5; int x = (int) d / 2;</code>, x equals
2
2.5
Compile error
3
Explanation
Cast applies first to d → 5; then 5/2 (int division) = 2.
Want 10 more like this — adaptive to your weak spots?