feat: add while.zig

This commit is contained in:
2022-08-27 19:16:10 +08:00
parent 286e316ac5
commit c3fc9e9188

11
single_files/while.zig Normal file
View File

@@ -0,0 +1,11 @@
const std = @import("std");
const print = std.debug.print;
pub fn main() void {
var sum: i32 = 0;
var i: i32 = 0;
while (i <100) : (i += 1) {
sum += i;
}
print("Sum: {}\n", .{sum});
}