Skip to the task
Layout
Back to classic view

You are looking at: Practice test 1. Your place is still lesson 5, task 1: Functions.

CHECKTask 4 of 17 · step 2: Questions 1–6

The largest int plus one

What happens?

int x = 2147483647;
x = x + 1;
printf("%d\n", x);
Stuck?

Undefined behaviour: an int overflow. You often see -2147483648, but C doesn't promise it; CI with UBSan stops: signed integer overflow. (Topic 2)