Hello World
Have you ever come across this word? If you have learnt any programming language in your life, I bet the answer is ‘yes’. I can still remember my school days when I used to print ‘Hello World’ in QBasic. Since then, I have learnt many other programming languages and every time the first chapter happens to begin from Hello World. So, I thought of researching on it a bit.
History:
The first known instance of the usage of the words “hello” and “world” together in computer literature occurred earlier, in Kernighan’s 1972 Tutorial Introduction to the Language, with the following code
main( ) {
extrn a, b, c;
putchar(a); putchar(b); putchar(c); putchar('!*n');
}
a 'hell';
b 'o, w';
c 'orld';
(**source: Wikipedia**)
Hello World Program:
A program to print ‘Hello World’ is thought to be the basic program from which a person starts to learn a particular language. It is assumed to be a kind of tradition. Even a novice who doesn’t know about programming can understand the program with little guidance. An expert can interpret the working of a new programming language by looking into its syntax and structure.
So, the next you want to learn any programming language, just google – ” Hello world in *prog. lang.* “
Compilation of few programs to print ‘Hello World‘
C
int main()
{
printf(“Hello World”);
return 0;
}
Qbasic
CLS
PRINT"Hello!"
END
C++
int main()
{
cout << “Hello World”;
return 0;
}
JAVA
class myfirstjavaprog
{
public static void main(String args[])
{
System.out.println("Hello World!");
}
}
HTML
<html>
<head>
<title>HTML Hello World</title>
</head>
<body>
<p>Hello World</p>
</body>
</html>
PHP
<?php
echo “Hello World”;
?>
Javascript
<script>
document.write('<b>Hello World</b>');
</script>
ASP.NET
<%
HelloWorldLabel.Text = "Hello, world!";
%>
I always wondered why they always teach that first.
this is quite interesting post.