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:

SpecifierTypeExample
%dSigned integerPrint("%d\n", 42);42
%uUnsigned integerPrint("%u\n", 255);255
%fFloating pointPrint("%f\n", 3.14);3.140000
%sStringPrint("%s\n", "hi");hi
%cCharacterPrint("%c\n", 65);A
%xHexadecimalPrint("%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:

  1. Name: HolyC
  2. Version: 1
  3. Year: 1999

Each on its own line.

Aiwnios HolyC loading...
Loading...
Click "Run" to execute your code.