Hello World program in c

Hello Word C program

Simple C Program and Explanation

Program:

#include <stdio.h>

int main() {
    printf("Hello, World!\\n");
    return 0;
}
    

Explanation:

#include <stdio.h>: This line includes the standard input/output library in C, which allows you to use the printf function.

int main(): This is the main function where the execution of the program begins. The int before main() indicates that this function returns an integer value.

printf("Hello, World!\\n");: This line prints the text "Hello, World!" to the console. The \\n at the end adds a new line after the text.

return 0;: This line indicates that the program has ended successfully. Returning 0 is a convention in C that signifies successful execution.

Comments

Popular Posts