First C Program – Detailed Explanation With Header File

1.Open Dev C++ and go to File > New > Empty File.

2.Write the following C code and save the file as test (File > Save File as):

 

1. #include <stdio.h>
2.
3. int main() {
4. printf(“Hello World!”);
5. return 0;
6. }

 

This program is written in the C language and is intended to print the phrase “Hello World!” to the console.

The code begins with the line

1.#include <stdio.h>,

which tells the compiler to include the contents of the standard input/output header file.

This header file contains the definitions and declarations of functions used for input and output, such as the printf() function used in this program.

2.A blank line. C ignores white space. But we use it to make the code more readable.

3.main() function. {}

The main() function is the entry point of all C programs, and is where the program execution begins.  {Program Body}

 

4.The next line is a call to the printf() function, which prints the string “Hello World!” to the console.

5.Finally, the return 0 statement tells the program to return a value of 0 to the calling function, which indicates that the program has executed successfully.

6.}  –  Program Body Close.

Leave a Reply

Your email address will not be published. Required fields are marked *

https://atozonlinesolutions.com/wp-content/uploads/2017/03/logo_white.png
https://atozonlinesolutions.com/wp-content/uploads/2017/03/logo_white.png
About
Products
Subscribe

If you wish to receive our latest news in your email box, just subscribe to our newsletter. We won’t spam you, we promise!

    Applauz

    As the pioneer of the lean startup movement, APPLAUZ has dedicated it’s time to sharing effective business strategies that help new businesses and enterpreneurs put their money to work in the right way.

    Subscribe

    If you wish to receive our latest news in your email box, just subscribe to our newsletter. We won’t spam you, we promise!

      Applauz

      As the pioneer of the lean startup movement, APPLAUZ has dedicated it’s time to sharing effective business strategies that help new businesses and enterpreneurs put their money to work in the right way.

      Copyright by BOLD THEMES. All rights reserved.