Home / Programs / My First Program In C: Hello World!!
Programming Example

My First Program In C: Hello World!!

👁 71,042 Views
💻 Practical Program
📘 Step by Step Learning
In this section we will learn that how to write first program in C programming language. hello world!!

Information & Algorithm

In this section we will learn that how to write first program in C programming language. hello world!!

Program Code

#include"stdio.h"

int main() {
   /* my first program in C */
   printf("Hello, World! \n");
   
   return 0;
}

Output

Hello, World!

Explanation

This is our first program in c Programming Language

 #include"stdio.h"

"stdio.h" is basically a predefined standard input output library Which contain functions, marcos and variables.

#include"stdio.h" defines that it is including stdio.h library files with this program.

"printf" is a predefined function which is used to display something on the screen. In this program we want to display "Hello, World!" .

There are four types of functions in C :

1) function with arguments and return value

2) function with arguments and no return value

3) function with no argument and return value

4) function with no argument and no return value

'return value' means, the process or function after performing the certain operation gives you back a resultto the parent function from which it is being called. Actually, main is the parent function of all the functions in C. If we do not need any return value we use return type void but here we use return type int.

return 0 defines that, it will returns 0 .

How to learn from this program

First read the algorithm, then study the program code line by line. After that, compare the code with the output and finally go through the explanation. This approach helps learners understand both the logic and the implementation properly.