Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Proper Hello, World! in C [closed]

Tags:

c

What is the correct Hello, World! program in C?

Since the first page of Google results for "c hello world" vary greatly and many are old C, I would like the standard version in one place for easy copy and paste.

like image 331
Tor Klingberg Avatar asked Sep 08 '25 12:09

Tor Klingberg


2 Answers

Depends how lazy you are: :)

#error Hello World
like image 143
Aesthete Avatar answered Sep 11 '25 03:09

Aesthete


I believe this is a standard Hello, World! program in C:

#include <stdio.h>

int main(void)
{
  printf("Hello World\n");
  return 0;
}
like image 36
Tor Klingberg Avatar answered Sep 11 '25 02:09

Tor Klingberg