C/C++ Arena

Step 1 of 5

Your first program

A program is a list of instructions the computer follows from top to bottom. C is a compiled language: you write the instructions as text (the source code), a tool called the compiler checks them and translates them into machine code the processor can run, and then the program runs. Every time you press Check, a real C compiler does exactly that in your browser.

The shape of every C program

#include <stdio.h>

int main(void) {
    printf("Hi!\n");
    return 0;
}
Hi!

Line by line:

Common mistakes

Your task

Fill in the blank so the program prints Hello, World!.

Challenge 2

Fill in both blanks: the function that prints text, and the keyword that ends main and hands back 0. The program should print GG, well played!.

Challenge 3

This time there is no starter program. Write the whole thing yourself: the #include, main, a printf and return 0;. It should print Welcome to the arena.

Next: Printing your own text