← Back to archive

Stdle #29 · strings · 2026-07-05

What does this C snippet output?

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

#include <stdio.h>
#include <string.h>
int main(void) {
char s[] = "level";
int n = strlen(s);
int pal = 1;
for (int i = 0; i < n / 2; i++)
if (s[i] != s[n - 1 - i]) pal = 0;
printf("%d\n", pal);
return 0;
}
Strings
4 attempts left

Answer & explanation