Writing and running a "Hello, World" program in C
This tutorial explains how to create and run a simple program in the C programming language (using the tcc C compiler) on MontaukOS.
- Open the Text Editor by navigating to the 'Applications' section in the app menu.
- Type:
into the Text Editor window. This code outputs the string "Hello, World!" along with a line break to the Terminal.#include <stdio.h> int main(void) { printf("Hello, World!\n"); return 0; } - Click the Save (floppy disk) button on the top panel. Choose a directory to save your code in - for example, your Home folder - give the source file a name ending in .c, and click 'Save'.
- Open the Terminal app by navigating to the 'Applications' section in the app menu. You should see something like this appear on your screen:
MontaukOS Copyright (c) 2025-2026 Montauk Operating System Project Logged in as admin Type 'help' for available commands. 0:/users/admin> - If you saved your program's source file somewhere other than your Home directory, switch to the directory in which you saved your program using the cd command. For example,
cd Documents. - Type '
tcc' followed by your program's name, and then press enter. For example, 'tcc hello.c'. - Run your program by typing its name without the '.c' extension, before pressing enter - for example, "hello".
- You should see "Hello, World!" displayed in the Terminal window. Congratulations!
Did you know? The MontaukOS Text Editor provides syntax highlighting for C and Lua files.