33
Total Posts
3
Categories
24/7
Updated

C

Hello Wold in C

Published on Dec 19, 2025
#include <stdio.h>
int main() {
    printf("Hello, World!\n");
    return 0;
}

Documentation

  • #include <stdio.h>: This is a preprocessor directive that tells the C compiler to include the standard input/output library (stdio.h). This library contains the declaration for the printf() function used to display output.

  • int main(): The main() function is where the execution of any C program begins. The int indicates that the function will return an integer value upon completion.

  • printf(\"Hello, World!\\n\");: The printf() function prints the text enclosed in the double quotes to the standard output (usually the console). The \\n is an escape sequence that moves the cursor to a new line after printing.

  • return 0;: This statement ends the main() function and returns the integer value 0 to the operating system, which indicates that the program executed successfully.

  • { and }: These curly braces define the beginning and end of the main() function\'s body.