#include <stdio.h>
int main() {
printf("Hello, World!\n");
return 0;
}
#include <stdio.h>
: This line includes the standard input-output header file, which is necessary for using the printf function.
int main() {
: This line marks the beginning of the main function, the entry point of every C program. The int
before main
indicates that the function returns an integer.
printf("Hello, World!\n");
: This line uses the printf function to print the string "Hello, World!" to the console. The \n
is an escape sequence for a newline character, which moves the cursor to the next line.
return 0;
: This line indicates that the program has executed successfully, and the main function returns an integer value of 0.
}
: This closing brace marks the end of the main function.