First Steps

Get started with learning about the structure of a C program for printing to the screen.

For our first step into the vast world of C, we’ll start by writing a simple program to display something to the console. We’ll then see some related things that’ll be helpful in the long run.

C uses the printf function to output whatever data we have.

A first C program

The printf function is part of a C library (the standard I/O library) which contains many other useful functions as well. It is a standard practice to include the library into your code. This can be done by typing #include <stdio.h> at the top of our code. This #include line is called an include directive, as it’s an instruction to include the library in our code.

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy