Q:

C Hello World program

belongs to collection: C programs - Basic C Programs

0

Hello World! program is the basic program to get started with any programming language. It is use to demonstrate the basic syntax of a programming language. Write C program simply prints Hello World! on the screen.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

C Hello World program - Source code

 #include<stdio.h>
 
int main()
{
   printf("Hello World!");
   return 0;
}

Program Output

Hello World!

Program Explanation

Generally, C programs start with the inclusion of header files. Here we include the stdio.h (standard input output) header file because we have used printf function in our program. These header files are also called as preprocessor commands. The stdio.h header file includes inbuilt functions for input and output like printf, scanf, etc. If you try to use printf function without writing the stdio.h header file, the compiler will throw an error.

The execution of a C program starts at the main function. The int before the keyword main is the return type(integer in this case).

The printf function output on the screen whatever is written in the double quotes. The program ends when it encounter a return statement. Here we are existing the program by returning 0 to the operating system.

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C program to find the greatest of three numbers... >>