Java Arithmetic and Operator Precedence
What is the value of the variable d after the following code segment is executed?
int a = 8 / 2 + 5;
int b = 7 % 3 * 4;
int c = a - b;
double d = c * 2.0;
A
8.0
B
0.0
C
4.0
D
10.0
Question Leaderboard
| Rank | |||||
|---|---|---|---|---|---|
| #1 | patrickmeijer009 | 1 | 1 | 0m 03s | 97 |
| #2 | lsj08030922 | 1 | 1 | 0m 38s | 62 |
| #3 | test123 | 0 | 1 | 0m 06s | -16 |
| #4 | richa.tuli | 1 | 1 | 5m 50s | -250 |
Items per page:
10
1 – 4 of 4
APFIVE