Ad space (banner)
๐Ÿ”งC Lessons
Lesson 2 / 68

Your First Output (printf)

This lesson covers the basics of output in C using printf, and introduces what makes C distinctive as a language. It's for anyone searching "C printf tutorial."

printf prints text to the screen. C is a historic language often called the root of all languages. It's used close to the core of how a computer operates โ€” operating systems, embedded devices, and more.

The example loads standard input/output functionality with #include <stdio.h>, then writes a single line, printf("Hello, C! "), inside the required framework of int main(void). Notice you need to explicitly specify a line break with .

A common early mistake is forgetting #include. In C, you need to include a header file for each piece of functionality you use, and forgetting to do so produces a compile error.

In real projects, C is still widely used today for writing low-level logic close to how a computer actually operates โ€” operating system and embedded-device development, in particular.

๐Ÿ“– Reference code
โœ๏ธ Your code
Type your code, then press "Run"

๐Ÿงช This site can't compile or run C directly, so it checks on the spot whether what you typed matches the reference code (scoring happens entirely in your browser โ€” nothing is sent anywhere).

Ad space (banner)
Ad space (in-article)