← Back to archive

Stdle #34 · control · 2026-07-10

What does this Zig snippet output?

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

const std = @import("std");
pub fn main() void {
const result = outer: {
var i: u32 = 0;
while (i < 10) : (i += 1) {
if (i * i > 50) break :outer i;
}
break :outer 0;
};
std.debug.print("{d}\n", .{result});
}
Control Flow
4 attempts left

Answer & explanation