how to print hello world in c

#include <stdio.h>

int main() {
    printf("Hello, World!");
    return 0;
}
  1. #include <stdio.h>: This line includes the standard input/output library header file, stdio.h, which contains functions like printf that we will use to display output on the screen.

  2. int main() {: This line declares the main function, which is the entry point of a C program. The int keyword indicates that the function returns an integer value. The empty parentheses () indicate that the main function takes no arguments.

  3. printf("Hello, World!");: This line uses the printf function to display the string "Hello, World!" on the screen. The printf function is a standard library function that allows us to print formatted output.

  4. return 0;: This line returns the value 0 from the main function, indicating successful program execution. This value is conventionally used to indicate a successful program termination.

The complete code above will print the output "Hello, World!" when executed.