Difference between revisions of "Hello, world"

From Computer History Wiki
Jump to: navigation, search
m (+cat)
(Earlier B version.)
 
Line 1: Line 1:
 
'''Hello World''' is the canonical 'shortest example [[program]]' in any given [[programming language]]; a program which simply prints 'hello, world', and then terminates.
 
'''Hello World''' is the canonical 'shortest example [[program]]' in any given [[programming language]]; a program which simply prints 'hello, world', and then terminates.
  
It started with one in the '[[C programming language|C]] Tutorial' in [[UNIX Sixth Edition|UNIX V6]]:
+
The first version appeared in "''A Tutorial Introduction to the Programming Langauge [[B programming language|B]]''":
 +
 
 +
<pre>
 +
main( ) {
 +
extrn a, b, c;
 +
putchar(a); putchar(b); putchar(c); putchar('!*n');
 +
}
 +
 
 +
a 'hell';
 +
b 'o, w';
 +
c 'orld';
 +
</pre>
 +
 
 +
It was popularized with one in the '[[C programming language|C]] Tutorial' in [[UNIX Sixth Edition|UNIX V6]]:
  
 
<pre>
 
<pre>
Line 10: Line 23:
  
 
{{semi-stub}}
 
{{semi-stub}}
 +
 +
==External links==
 +
 +
* [https://www.bell-labs.com/usr/dmr/www/bintro.html A Tutorial Introduction to the Programming Language B]
 +
* [https://www.bell-labs.com/usr/dmr/www/ctut.pdf Programming in C - A Tutorial]
  
 
[[Category: Demo Software]]
 
[[Category: Demo Software]]

Latest revision as of 08:10, 20 June 2023

Hello World is the canonical 'shortest example program' in any given programming language; a program which simply prints 'hello, world', and then terminates.

The first version appeared in "A Tutorial Introduction to the Programming Langauge B":

main( ) {
 extrn a, b, c;
 putchar(a); putchar(b); putchar(c); putchar('!*n');
}

a 'hell';
b 'o, w';
c 'orld';

It was popularized with one in the 'C Tutorial' in UNIX V6:

main() {
	printf("hello, world");
}

External links