I'm new to Zig but I think this is how you would do it:
{
var i: usize = 0;
while (i < 10) : (i += 1) {
// use i
}
}