Online GDB Pro

Learn C programming online: interactive lessons

printf, variables, scanf, if, loops, arrays and functions, compiled with Clang in your browser. Free, no sign-up: your progress is saved in this browser.

Lesson 1 · C

Hello, C

Every C program starts in main. printf prints text; \n ends the line. #include <stdio.h> makes printf available.

Your task: Print Hello, C! followed by a new line.

#include <stdio.h>

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

Your output

 

Expected output

Hello, C!