Write a C Program to Print Hello World Program

By | October 2, 2016

C Program to Print Hello World Program


Write a C Program to Print Hello World Program. In this program ,we just print the “Hello World!” line on the computer screen.

This is the basic Example for the beginners of C Programming Language….Let’s have a look at the program below :


A C program basically consists of the following parts −


  • Preprocessor Commands
  • Functions
  • Variables
  • Statements & Expressions
  • Comments

 


Let us look at a simple code that would print the words “Hello World” −


#include<stdio.h>

int main() {

printf("Hello, World! \n");

return 0;
}

Let us take a look at the various parts of the above program −


  • The first line of the program #include is a preprocessor command, which tells a C compiler to include stdio.h file before going to actual compilation.

  • The next line int main() is the main function where the program execution begins.

  • The next line /*…*/ will be ignored by the compiler and it has been put to add additional comments in the program. So such lines are called comments in the program.

  • The next line printf(…) is another function available in C which causes the message “Hello, World!” to be displayed on the screen.

  • The next line return 0; terminates the main() function and returns the value 0.


Compile and Execute C Program : :

Hello, World!


Above is the source code for C Program to Print Hello World Program which is successfully compiled and run on Windows System.The Output of the program is shown above .

If you found any error or any queries related to the above program or any questions or reviews , you wanna to ask from us ,you may Contact Us through our contact Page or you can also comment below in the comment section.We will try our best to reach up to you in short interval.


Thanks for reading the post….

Leave a Reply