mm mm

Hello World in 30 different languages

Ada

BEGIN DISPLAY("HELLO WORLD!") END.

Algol

BEGIN DISPLAY("HELLO WORLD!") END.

Assembly

global _main
extern _printf

section .text
_main:
    push message
    call _printf
    add esp, 4
    ret
message:
    db 'Hello, world!', 10, 0

C

#include <stdio.h>

int main(void)
{
    puts("Hello, world!");
}

C#

console.writeline("Hello, world!");

C++

#include <iostream>

int main()
{
    std::cout << "Hello, world!";
    return 0;
}

Cobol

IDENTIFICATION DIVISION.
PROGRAM-ID. hello-world.
PROCEDURE DIVISION.
    DISPLAY "Hello, world!".

CoffeeScript

console.log 'Hello, world!'

Dart

main() {
  print('Hello World!');
}

Delphi

program HelloWorld;

begin
  WriteLn('Hello, world!');
end.

F#

printfn "Hello World"

Fortran

program helloworld
    print *, "Hello world!"
end program helloworld

Go

println("Hello, world!");

Haskell

module Main where

main :: IO ()
main = putStrLn "Hello, World!"

HTML

<p>Hello world</p>

Java

public class HelloWorld {
    public static void main(String[] args) {
        System out println("Hello, World!");
    }
}

JavaScript

console.log('hello, world!')

Kotlin

fun main(args: Array<String>) {
  println("Hello World!")
}

Lisp

(print "Hello world")

Matlab

disp('Hello, world!')

Pascal

Writeln('Hello, world!');

Perl

print "Hello, world!\n";

PHP

echo "hello world!";

Python

print('Hello, world!')

R

cat("Hello world\n")

Ruby

puts "Hello World!"

Scala

object HelloWorld extends App {
  println("Hello, World!")
}

Swift

println("Hello, world!");

Tcl

puts "Hello World!"

TypeScript

console.log('Hello, world!')