Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Your First Program

Now that you have GLaDOS installed, let's write your first program!

Hello World

Create a file called hello.c:

int main() {
    int x = 5;
    int y = 10;
    int result = x + y;
    return result;
}

Compile and Run

./glados < hello.c

Expected output:

VInt 15

Congratulations! You've just compiled and run your first GLaDOS program. The program adds two numbers and returns the result.

Next Steps

Now that you've written your first programs, you can: