English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Comprehensive Collection of C Programming Examples
In this example, you will learn to print 'Hello, World!' on the screen of C language programming.
#include <stdio.h> int main() { //printf() displays the string within the quotes printf("Hello, World!"); return 0; }
Output result
Hello, World!
#include is a preprocessor command that tells the compiler to include the content of the stdio.h (standard input and output) file in the program.
The stdio.h file includes functions such as scanf() and printf(), which are used to obtain input and display output.
If you use the printf() function under the condition of using #include <stdio.h>, the program will not compile.
The execution of a C program begins with the main() function.
printf() is a library function used to send formatted output to the screen. In this program, printf() displays the text "Hello, World!" on the screen.
The return 0; statement is the program's“Exit Status”In simple terms, the program ends with this statement.