← Back to archive

Stdle #107 · storage · 2026-09-21

What does this C snippet output?

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

#include <stdio.h>
int next(void) {
static int x = 10;
x += 5;
return x;
}
int main(void) {
printf("%d\n", next());
printf("%d\n", next());
return 0;
}
Storage
2 lines
4 attempts left

Answer & explanation