Hello World in C

This C Hello World example shows beginners how to output the text Hello, World! using C.

Hello World in C

Copy and paste this C Hello World example into your editor, compiler, terminal or runtime.

#include <stdio.h>

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

About this C example

Hello World programs are commonly used to confirm that a programming language environment is working correctly. This example gives you a simple starting point for C.

Back to all Hello World examples

The History of C

C has an interesting history and continues to be used by developers, students and organisations around the world. The language was created to solve specific technical challenges and has evolved over time through new versions, tools and community contributions. Depending on the language, it may be used for business software, web applications, scientific computing, systems programming, education or specialist industries. Learning about the origins of C helps provide context for how it is used today and why it remains relevant. Many people begin their journey with a Hello World in C example because it provides a simple introduction to the syntax and structure of the language. From that first program, developers often progress to larger projects and gain a deeper understanding of programming concepts. Although technologies change, C continues to be an important part of the software development landscape and remains a valuable language to learn.

What is C used for today?

C is still widely used today for operating systems, embedded software, firmware, compilers, databases and performance-critical applications. It gives developers direct control over memory and hardware-level behaviour, which makes it valuable where efficiency and predictability matter. A Hello World in C example usually introduces the main function, the stdio.h header and the printf function, all of which are important foundations for understanding how C programs are structured. Because C influenced many later languages, learning it can also help developers understand C++, C#, Java and other C-style languages more deeply.

Why learn C?

Learning C gives developers a strong understanding of how programs interact with memory, processors and operating systems. It is not always the easiest first language, but it teaches concepts that are often hidden in higher-level languages. Writing a Hello World in C program is a small first step towards understanding compilation, headers, functions and low-level execution. Developers who learn C often gain a deeper appreciation of performance, memory allocation and the foundations of modern software.

Explore more Hello World examples

Continue learning with more beginner-friendly Hello World examples in other programming languages.