First program in C

C programming uses some syntax and notations that may seem unfamiliar to the people who haven’t programmed computers.

So before you go through the tutorials of C programming, we just begin by writing the first program in C to print a line.

First program in C

My first program in C: Hello World !!!

Program to display “Hello world!!!”

/* This is my first program in C..*/
#include <stdio.h>
int main()
    printf("Hello world!!!\n");
    return 0;


Hello World!!!

Even though the program is simple as it is the first program in c to make you familiar with the programs written in C programming.

It illustrates several important features of C programming language.

Explanation of the Program

Line 1:

The first line of the program begins with /* and ends with */ which represents that any text written between these two symbols is a comment.

Comments do not affect program while running because C compiler ignores the comments and programmers use these comments for the documentation of the program.

Line 2:

#include <stdio.h>

This is the directive to the C Preprocessor (You might wonder what these words like preprocessor and directives are but don’t worry these things will be crystal clear after going through next chapters).

Lines beginning with # are called preprocessor directives and this specific line tells preprocessor to include the contents of standard input/output header file ( stdio.h) in the program while the program is being compiled.


Line 3:

int main ( )

This is the main functions of the program which is part of every C program.

C programs can have multiple functions which are also called the building blocks, however, one of the function should be main.

The code of the function is written between the curly braces and in this program also the body of the function is enclosed by the braces in line 4 and 7.

Line 5:

printf("Hello World!!!");

This is the standard output functions which instruct the computer to print anything written between the quotes (” ..text..”).

This entire line including the printf, its arguments within the parenthesis and the semicolon is called a statement.

Every statement must end with a semicolon.

Good Programming Practice
While writing C program, commenting is a good idea which makes clear about the purpose of the function.


Line 6:

return 0;

This is nothing but an exit sequence for the function.

Moreover, it signifies the termination of the function main returning the integer value 0.

Escape sequence in C Programming

Escape sequences are the characters which are not printed. The \ backslash is called escape character.

Escape sequence Description
\n Newline. This will place a cursor on the beginning of the second line.
\t Tab. This will insert horizontal tab.
\\ Backslash. Insert backslash in a string.
\a Alert. This will signify alert sign or sound without changing the position of cursor