← Back to archive

Stdle #73 · strings · 2026-08-18

What does this C snippet output?

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

#include <stdio.h>
int main(void) {
char s[] = "abcABC";
int diff = 0;
for (int i = 0; s[i]; i++)
if (s[i] >= 'a' && s[i] <= 'z') diff++;
printf("%d\n", diff);
return 0;
}
Strings
4 attempts left

Answer & explanation