C "Hello, World!" Program - Write Your First C Program

Hello World Program

The simplest C program prints a message to the screen. This example shows how to write "Hello, World!" using the standard library.

#include <stdio.h>
int main() {
    printf("Hello, World!\n");
    return 0;
}
Hello, World!
        

This program demonstrates how every C program starts execution from the main() function. The printf() call sends a string to the standard output, and returning 0 tells the operating system that the program completed successfully.

Sai Kishore Randhi, author
About the author

Sai Kishore Randhi

Embedded systems, VLSI, and chip design

Sai Kishore writes about embedded systems, VLSI, chip design, and the programming concepts behind modern hardware.

View LinkedIn profile ↗