Lesson 2 of 18
Print and Output
Print and Output
HolyC's Print function is a powerful, printf-compatible built-in. You use it for all text output.
Format Specifiers
Print supports the standard C format specifiers:
| Specifier | Type | Example |
|---|---|---|
%d | Signed integer | Print("%d\n", 42); → 42 |
%u | Unsigned integer | Print("%u\n", 255); → 255 |
%f | Floating point | Print("%f\n", 3.14); → 3.140000 |
%s | String | Print("%s\n", "hi"); → hi |
%c | Character | Print("%c\n", 65); → A |
%x | Hexadecimal | Print("%x\n", 255); → ff |
Multiple Values
You can print multiple values in one call:
Print("x=%d y=%d\n", 10, 20);
This prints: x=10 y=20
String Literals
HolyC string literals use double quotes. Escape sequences work as in C:
\n— newline\t— tab\\— backslash\"— double quote
Print("Line 1\nLine 2\n");
Print("Tab:\there\n");
Your Task
Print three lines:
Name: HolyCVersion: 1Year: 1999
Each on its own line.
Aiwnios HolyC loading...
Loading...
Click "Run" to execute your code.