C “Hello World!“ Programming for beginners

C “Hello World!“ Programming for beginners

In this example of C tutorial, you will take the first step to print “Hello World” on the screen/console.

Writer a C program to print “Hello World!”

Program:


================================




================================

Output:

================================

Hello World!

================================

C “Hello World!“ Programming for beginners

Explanation of the program:

# : If any line start with #, it is a pre-process only that line. Special symbol (#) to indicate the pre-processor directive. 

include : pre-processor directive. I include important file in the C program.

stdio.h : This file contains functions such as printf() and scanf() to print in the screen and taking input from the user.

main( ) : The C program execution starts from this line. The main() function is called by the operating system (O/S).

printf( ) : It is a function defined in the stdio.h header file, to print or send output to the screen/console.

return 0 : This statement is to Exit the program. It tells the operating system (O/S) that the program has run successfully, as 0 means success. In place of 0 we can use any number like 1, 2,… but the general convention is to write 0.