Print Statements
We'll write a very basic C statement which displays some text on the screen. Let's begin.
We'll cover the following
For our first step into the vast world of C, we will start by writing a simple print statement. We use such a statement any time we want to display something on the console.
C uses the printf
command to output whatever data we have.
printf
printf
is part of the C 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 your code.
Now, on to the main part of the lesson. Let’s print “Hello World” in our console:
Create a free account to access the full course.
By signing up, you agree to Educative's Terms of Service and Privacy Policy