C Program to display "Hello, World!"

Problem

Write a program in C to display “Hello, World!” on the screen.

C Program to display “Hello, World!” in Console Window.

# include <stdio.h>
int main()
{
    // using printf to display the Hello,World string AbundantCode - 12.10
    printf("Hello, World!");
    return 0;
}
image

In the above example , the #include<stdio.h> is a preprocessor command that informs the compiler to include the stdio.h header file in the program. This header file includes some of the commonly used functions like scanf and printf which are used to read and write from/to the console window.

The main() function is the entry point for the program and returns 0 which defines the exit status of the program.