Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions exercises/003_assignment.zig
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ const std = @import("std");

pub fn main() void {
const n: u8 = 50;
n = n + 5;
const n_added: u8 = n + 5;

const pi: u8 = 314159;
const pi: u32 = 314159;

const negative_eleven: u8 = -11;
const negative_eleven: i8 = -11;

// There are no errors in the next line, just explanation:
// Perhaps you noticed before that the print function takes two
// parameters. Now it will make more sense: the first parameter
// is a string. The string may contain placeholders '{}', and the
// second parameter is an "anonymous list literal" (don't worry
// about this for now!) with the values to be printed.
std.debug.print("{} {} {}\n", .{ n, pi, negative_eleven });
std.debug.print("{} {} {}\n", .{ n_added, pi, negative_eleven });
}