Hello World Program in C
In this tutorial, we will learn how to write a Hello World program in C language. We will go through each statement of the program.
C Program
#include <stdio.h>
int main() {
printf("Hello, World!\n");
return 0;
}Output
Hello, World!
Working of the "Hello, World!" Program
#include <stdio.h>
This line includes the standard input-output header file. Thestdio.hlibrary contains functions for input and output operations, such asprintf.int main()
This line defines the main function where the program execution begins. Theintkeyword indicates that the function returns an integer value.{
This opening brace marks the beginning of the main function's body.printf("Hello, World!\n");
This line prints the string "Hello, World!" to the standard output (usually the screen). The\nis an escape sequence that adds a new line after the text.return 0;
This line ends the main function and returns the value 0 to the calling process. In C, returning 0 typically indicates that the program executed successfully.}
This closing brace marks the end of the main function's body.