Hello, World!
Where does "Hello, World!" come from?
"Hello, World!" is a phrase widely used by programmers around the globe. It has become a tradition to use this phrase as the first program written when learning a new programming language.
The tradition of using "Hello, World!" originated from the book The C Programming Language by Brian Kernighan and Dennis Ritchie, first published in 1978. In this seminal book, a simple code example is presented in the opening chapter that prints "Hello, World!" to the screen. This example was designed to introduce readers to the basic syntax of the C programming language.
Although the phrase gained widespread popularity with this book, earlier variations of simple output programs, such as printing "Hello" can be traced back to older programming tutorials. However, it was Kernighan and Ritchie's work that solidified the use of "Hello, World!" as a tradition in programming education.
Here is an example of "Hello, World!" in different programming languages:
- Python
print("Hello, World!")
- Go
println("Hello, World!");
- JavaScript
console.log("Hello, World!");
- C
#include <stdio.h>
int main() {
printf("Hello, World!");
return 0;
}
- C++
#include <iostream>
int main() {
std::cout << "Hello, World!";
return 0;
}
- C#
namespace HelloWorld
{
class Hello {
static void Main(string[] args)
{
System.Console.WriteLine("Hello, World!");
}
}
}
- Java
import java.io.*;
class GFG {
public static void main (String[] args) {
System.out.println("Hello, World!");
}
}
- Assembly
section .data
msg db 'Hello, World!', 0Ah
section .text
global _start
_start:
mov eax, 4
mov ebx, 1
mov ecx, msg
mov edx, 13
int 0x80
mov eax, 1
xor ebx, ebx
int 0x80
- Brainfuck
++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.