Skip to content
Novus Examples
c123 B

C — Hello World

The classic hello-world in C — an include, main, and printf — for testing highlighters, C compilers, and parsers against the canonical first program.

Preview — first 8 linesc
/* The classic first program, in C. */
#include <stdio.h>

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

Specifications

Language
C
Kind
hello-world
Lines
7
Encoding
UTF-8
Line Endings
LF

What is a .c file?

C (.c) is a plain-text source file for the C programming language — a low-level, statically typed, compiled language that maps closely to hardware. It underpins operating systems, embedded firmware, and language runtimes, using manual memory management, pointers, structs, and the preprocessor.

How to use this file

Use an example .c file to test syntax highlighters, C compilers (gcc, clang) and their diagnostics, static analysers, formatters (clang-format), and parser or highlighting tooling.

Generated by generation/code_samples.py. Free for any use, no attribution required — license.