Tuesday, 2 May 2017

'Hello World' Program in C

A simple C program to display 'Hello World' on output screen. It's a very simple program to illustrate the syntax of a programming language and usage of'PRINTF() Function in C Language'.
C program to print

To better understand the use of Printf() check the Below Blog : 

        C Programming Input Output (I/O) Functions : printf() and scanf()

C Program to Display 'Hello World'

#include <stdio.h> void main() 
{
     printf('Hello World');
}
Output
Hello World
Line by Line Execution : 
  • The #include<stdio.h> is a preprocessor command. This command tells compiler to include the contents of stdio.h (standard input and output) file present in the complier into the program.
  • The stdio.h file contains functions such as scanf() to take input and print() display output respectively.
  • If you use printf() function without writing #include <stdio.h>, the program will not be compiled.
  • The execution of a C program starts from the main() function.
  • The printf() is a library function to send formatted output to the screen. In this program, the printf() displays 'Hello World' text on the screen.
  • As the  main() function is of  VOID type thus main() function the will not return any value and directly display the output on output window.

No comments:

Post a Comment