A “Hello, World!” program generally is a computer program that outputs or displays the message “Hello, World!”. Such a program is very simple in most programming languages, and is often used to illustrate the basic syntax of a programming language. It is often the first program written by people learning to code. It can also be used as a sanity test to make sure that a computer language is correctly installed, and that the operator understands how to use it.While small test programs have existed since the development of programmable computers, the tradition of using the phrase “Hello, World!” as a test message was influenced by an example program in the seminal 1978 book The C Programming Language. The example program in that book prints “hello, world“, and was inherited from a 1974 Bell Laboratories internal memorandum by Brian Kernighan, Programming in C: A Tutorial:
In the above example, the main( ) function defines where the program should start executing. The function body consists of a single statement, a call to the printf function, which stands for “print formatted”. This function will cause the program to output whatever is passed to it as the parameter, in this case the string hello, world, followed by a newline character.
The C language version was preceded by Kernighan’s own 1972 A Tutorial Introduction to the Language B, where the first known version of the program is found in an example used to illustrate external variables: