← Back to archive

Stdle #142 · control · 2026-10-26

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 {
comptime var sum: i32 = 0;
inline for (.{ 1, 2, 3, 4, 5 }) |v| {
sum += v;
}
std.debug.print("{d}\n", .{sum});
}
Control Flow
4 attempts left

Answer & explanation