← Back to archive

Stdle #142 · arrays · 2026-10-26

What does this C snippet output?

A past puzzle — fully playable. 4 attempts, hints on wrong guesses.

#include <stdio.h>
int main(void) {
int a[6] = {[4] = 1, [1] = 2};
printf("%d %d %d\n", a[1], a[4], a[5]);
return 0;
}
Arrays
4 attempts left

Answer & explanation