Skip to the task
Layout
Back to classic view

You are looking at lesson 6. Your place is still lesson 10, task 1: struct.

CHECKTask 19 of 28 · step 9: Drills: check yourself

What does it print?

What does this code print?

int a[5] = {1, 2, 3};
int s = 0;
for (int i = 0; i < 5; i++) {
    s += a[i];
}
printf("%d %d\n", a[4], s);
Stuck?

0 6. The missing boxes get 0, so the sum is 1 + 2 + 3.