C Program to Display "Hello, World!"

In this program, you will learn to display "Hello, World!" on console. It is most favourite program in programming language. Here we have used printf() function to display text on console.

In C programming language, printf() function is used to print the (“character, string, float, integer, octal and hexadecimal values”) onto the output screen.

We use printf() function with %d format specifier to display the value of an integer variable.

Similarly %c is used to display character, %f for float variable, %s for string variable, %lf for double and %x for hexadecimal variable.

To generate a newline, we use \n in C printf() statement.

This function is declared and related macros are defined in stdio.h which is a header file in C language.

Source Code

void main()
    printf("Hello, World!");
Hello, World!