← Back to archive

Stdle #24 · integers · 2026-06-30

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 x: u16 = 0xABCD;
const lo: u8 = @truncate(x);
const hi: u8 = @truncate(x >> 8);
std.debug.print("0x{x} 0x{x}\n", .{ hi, lo });
}
Integers
4 attempts left

Answer & explanation