Integer Overflow Behavior
What is the value of x after the following code segment is executed?
int x = Integer.MAX_VALUE;
x = x + 1;
A
0
B
Integer.MAX_VALUE
C
2147483648
D
Integer.MIN_VALUE
Question Leaderboard
| Rank | |||||
|---|---|---|---|---|---|
| #1 | kaisuki | 1 | 1 | 0m 00s | 100 |
| #2 | Potter16 | 1 | 1 | 0m 05s | 95 |
| #3 | chunxiangxu.cxu | 1 | 1 | 0m 13s | 87 |
| #4 | liuwilliam072410 | 1 | 1 | 0m 31s | 69 |
| #5 | richa.tuli | 0 | 1 | 1m 39s | -109 |
| #6 | lsj08030922 | 1 | 1 | 14m 59s | -799 |
| #7 | zgj07310417 | 2 | 2 | 18m 25s | -905 |
| #8 | bommasam000 | 0 | 3 | 19m 00s | -1,170 |
Items per page:
10
1 – 8 of 8
