100% found this document useful (6 votes)
1K views

"Hello, World!" in 66 Programming Languages

This document contains "Hello, world!" programs in many different programming languages, listed with the language name. It includes common languages like C, Java, Python, Perl, PHP as well as some less common languages like APL, Fortran, Postscript. The programs range from a simple print statement to output "Hello, world!" to slightly more complex programs to demonstrate basic language features.

Uploaded by

rapalot
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (6 votes)
1K views

"Hello, World!" in 66 Programming Languages

This document contains "Hello, world!" programs in many different programming languages, listed with the language name. It includes common languages like C, Java, Python, Perl, PHP as well as some less common languages like APL, Fortran, Postscript. The programs range from a simple print statement to output "Hello, world!" to slightly more complex programs to demonstrate basic language features.

Uploaded by

rapalot
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Hello, world!

* ABAP: "Hello, world!" * ABAP // Dylan: "Hello, world!" Dylan @ECHO OFF MS-DOS Batch
REPORT HELLO_WORLD. define method hello-world() REM DOS batch: "Hello, world!"
WRITE 'Hello, world!'. format-out("Hello, world!\n"); ECHO Hello, world!
end method hello-world;
hello-world();
-- Ada: "Hello, world!" Ada ; Mumps-M: "Hello, world!" Mumps-M
with Ada.Text_IO; use Ada.Text_IO; w !,"Hello, world!"
procedure Hello is // ECMAScript/JavaScript: "Hello, world!" ECMA/JavaScript
begin alert('Hello, world!');
Put_Line ("Hello, world!"); (* Oberon: "Hello, world!" *) Oberon
end Hello; MODULE Helloworld;
indexing Eiffel IMPORT Write;
description: "Eiffel: Hello, world!" BEGIN
HELLO: 'BEGIN' ALGOL class HELLO Write.Line("Hello, world!");
'COMMENT' CDC ALGOL 60: "Hello, world!" ; creation END Helloworld.
OUTSTRING(1, 'Hello, world!') run
'END' HELLO feature
run is program HelloWorld(output); Pascal
do (* Pascal: Hello, world! *)
<!-- Ant: "Hello, world!" --> Ant print("Hello, world!%N"); begin
<project name="Hello" default="hello"> end -- run WriteLn('Hello, world!');
<target name="hello" description="Greeting"> end -- HELLO end.
<echo message="Hello, world!"/>
</target>
</project> %% Erlang: "Hello, world!" Erlang # Perl: "Hello, world!" Perl
-module(hello). print "Hello, world!\n";
-export([hello/0]).
X APL: Hello, world! APL
Y- 'Hello, world!' hello() -> <?php // PHP: "Hello, world!" PHP
io:format("Hello, world!~n", []). echo "<html><body>"."Hello, world!"."</body></html>"; ?>

-- AppleScript: "Hello, world!" AppleScript


display dialog "Hello, world!" \ Gforth: "Hello, world!" Forth /* PL/1: "Hello, world!" */ PL/1
s" world!" s" Hello, " Hello: procedure options(main);
type type CR put skip list('Hello, world!');
<% @ Language="VBScript" %> ASP bye end Hello;
<% 'ASP: "Hello, world!"
Response.Write("<html><body>Hello, world!</body></html>") %>
C Fortran: Hello, world! Fortran R1.1(V0[:sig]) => R0 Plankalkül
PROGRAM HALLO R1.2(V0[:m x sig]) => R0
; NASM Intel 8086 Assembler (DOS): "Hello, world!" Assembler WRITE (*,100) 0 => i | m + 1 => j
org 100h STOP [W [ i < j -> [ R1.1(V0[i: m x sig]) => R0 | i + 1 => i ] ] ]
start: 100 FORMAT ('Hello, world!') END
MOV AH,09h END R1.3() => R0
LEA DX,[msg] 'H';'e';'l';'l';'o';',';' ';'w';'o';'r';'l';'d';'!' => Z0[: m x sig]
INT 21h R1.2(Z0) => R0
MOV AX,4C00h // Groovy: "Hello, world!" Groovy END
INT 21h println "Hello, world!"
msg: DB 'Hello, world!$'
% PostScript: "Hello, world!" PostScript
-- Haskell: "Hello, world!" Haskell /Courier findfont 24 scalefont setfont
# awk: "Hello, world!" awk main :: IO () 100 100 moveto (Hello, world!) show showpage
BEGIN { print "Hello, world!" } main = putStrLn "Hello, world!"

# PowerShell: "Hello, world!" PowerShell


/* A TUTORIAL INTRODUCTION TO THE LANGUAGE B B h Hello Write-Host "Hello, world!"
B. W. Kernighan Bell Laboratories, New Jersey,
January 1973 - first documented "hello, world!" */
CO HPGL: "Hello, world!"; HPGL % Prolog: "Hello, world!" Prolog
main( ) { IN0; ?- write('Hello, world!') , nl .
extrn a, b, c; PA0,0;
putchar (a); putchar (b); putchar (c); putchar ('!*n'); PR1000,1000;
} SP1; # Python: "Hello, world!" Python
a 'hell' ; PD; print "Hello, world!"
b 'o, w' ; DT!;
c 'orld' ; LBHello world!;
PU; /* REXX: "Hello, world!" */ REXX
PA 0,0; say 'Hello, world!'
# Bash: "Hello, world!" Bash SP0; exit
echo Hello, world!

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> HTML # Ruby: "Hello, world!" Ruby
10 REM BASIC: "Hello, world!" BASIC <!-- HTML: "Hello, world!" --> puts "Hello, world!"
20 PRINT "Hello, world!" <html><head><title>Greeting</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head><body><p>Hello, World!</p></body></html> ;;; Scheme: "Hello, world!" Scheme
Brainfuck: "HelloKOMMA World!" [-]++++++++++[>++++++ Brainfuck (define h(lambda()(display "\nHello, world!")(newline)()))(h)
+>++++++++++>++++>+++>+<<<<<-]>++.>+.+++++++..+++.>+
+++.>++.<<++++++++.--------.+++.------.--------.>>+. * INTERCAL: "Hello, world!" INTERCAL
PLEASE DO ,1 <- #13 DO ,1 SUB #9 <- #168 echo s | sed -ne '1s/.*/Hello, world!/p' sed
DO ,1 SUB #1 <- #238 DO ,1 SUB #10 <- #24
/BEGIN-PROCEDURE LOGGING=N BS2000 DO ,1 SUB #2 <- #112 DO ,1 SUB #11 <- #16
/REMARK BS2000 (SDF): "Hello, world!"
/ASSIGN-SYSDTA TO-FILE=*SYSCMD
DO ,1 SUB #3 <- #112 DO ,1 SUB #12 <- #158
'Hello, world!' print. Self
DO ,1 SUB #4 <- #0 DO ,1 SUB #13 <- #52
/WRITE-TEXT 'Hello, world!' DO ,1 SUB #5 <- #64 DO READ OUT ,1
/SET-JOB-STEP DO ,1 SUB #6 <- #238 PLEASE GIVE UP
/ASSIGN-SYSDTA TO-FILE=*PRIMARY DO ,1 SUB #7 <- #26 ! Simula: "Hello, world!" ; Simula
/END-PROCEDURE DO ,1 SUB #8 <- #248 Begin
OutText("Hello, world!"); OutImage;
End of program;
/* ANSI C: "Hello, world!" */ C // Java: "Hello, world!" Java
#include <stdio.h>
#include <stdlib.h> class HelloWorld { 'Hello, world!' out. Smalltalk
int main(void){ public static void main(String args[]) {
puts("Hello, world!"); return EXIT_SUCCESS; System.out.println("Hello, world!");
} } -- SQL: "Hello, world!" SQL
TEX
} SELECT 'Hello, world!' AS message;

// C#: "Hello, world!" C#


using System; <!-- Java Server Pages: "Hello, world!" --> JSP % TeX: "Hello, world!" TEX
class HelloWorld {
public static int Main(String[] args) {
<%@ page language='java' %> TEX LATEX Hello, world!
<%="Hello, world!" %> \bye
Console.WriteLine("Hello, world!");
return 0;
} % LaTeX: "Hello, world!" TEX LATEX .\" troff/groff: "Hello, world!" troff/groff
} \documentclass{article} \f(CW
\begin{document} Hello, world!
Hello, world!
// ISO C++: "Hello, world!" C++ \end{document}
#include <iostream> <!-- Velocity: "Hello, world!" --><html><body> Velocity
int main() { #set( $foo = "Hello, world!" )
std::cout << "Hello, world!" << std::endl; ; Logo: "Hello, world!" Logo $foo
} PRINT [Hello, world!] </body></html>
BYE

* COBOL 74: "Hello, world!" COBOL Whitespace


IDENTIFICATION DIVISION. B4 09 8D 16 0D 01 CD 21 B8 00 4C CD 21 48 65 6C Maschinencode
PROGRAM-ID. HELLO. 6C 6F 2C 20 77 6F 72 6C 64 21 24
ENVIRONMENT DIVISION.
MAIN SECTION.
<?xml version="1.0"?><!-- XML: "Hello, world!" --> XML
DISPLAY "Hello, world!" # make: "Hello, World!" MAKE <greet><how>Hello, </how><who>world</who><mark>!</mark></greet>
STOP RUN. all:
@echo "Hello, World!"
<?xml version="1.0"?><!-- XUL: "Hello, world!" --> XUL
;;; Common Lisp: "Hello, world!" Common Lisp <window xmlns=
(defun helloworld () (* Modula-2: "Hello, world!" *) Modula-2 "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
(print "Hello, world!") MODULE HelloWorld; <label value="Hello, world!"/></window>
)(helloworld) FROM InOut IMPORT WriteString,WriteLn;
BEGIN
WriteString("Hello, world!"); Poster-Bestellung und mehr Informationen: Impressum
* dBase IV: "Hello, world!" dBase WriteLn; http://www.lehmanns.de/helloworld
? "Hello, world!" END HelloWorld. Redaktion: Dirk Eckel, Christoph Kaeder, Matthias Stolt (Hamburg)

10623 Berlin 12489 Berlin 79098 Freiburg 20095 Hamburg 04109 Leipzig 93053 Regensburg 89081 Ulm Portofreie Lieferung
Hardenbergstr. 5 Rudower Chaussee 26 Friedrichring 25 Kurze Mühren 6 Grimmaische Str. 10 Universitätsstraße 31 Albert-Einstein-Allee 15 innerhalb Deutschland
Tel 030/617911-0 Tel 030/2093-2028 Tel 0761/3899010 Tel 040/336384 Tel 0341-3397500-0 Tel 0941/90830 Tel 0731/56600 Kostenlose Service Hotline
[email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] 0800-2662665 (COMBOOK)
10117 Berlin 91054 Erlangen 06108 Halle 50937 Köln 35037 Marburg 89073 Ulm siz - Service Internationale Email Newsletter
Friedrichstraße 128 Universitätsstraße 6 Universitätsring 7 Universitätsstr. 20 Steinweg 35 a Wengengasse 27 Zeitschriften 24 Themen Ihrer Wahl
Tel 030/2827079 Tel 09131/829644 Tel 0345/212150 Tel 0221/428153 Tel 06421/590120 Tel 0731/63334 Tel 0800/7492665 Subscribe/Unsubscribe unter:
[email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] www.lehmanns.de/email-news

You might also like