Learn to print Hi World! on the screen in C programming

 

In this model, you will figure out how to print "Hi, World!" on the screen in C programming.

Program to print hello world on Screen:

 

#include <stdio.h>

void main() 

{

   printf("Hi, World!");                             // printf() displays the string inside quotation

}

 

 

Output:

 

Hi, World!

 

 

How does "Hi, World!" program works?

1.     The #include is a preprocessor command that tells the compiler to include the contents of stdio.h (standard input and output) library in the program.

2.     The stdio.h file contains functions such as printf() to take input.

3.     Execution of a C program starts from the main() function.

4.     printf() is a library function to send output to the screen. In this program, printf() displays Hi, World! on the screen.

Comments

Popular posts from this blog

What is selenium WebDriver - Introduction, Architecture, Set up, Advantages and Disadvantages