Monday, 23 February 2009

"Hello world!" :)

The first application that any programmer learning any programming language is likely to write is Hello World. This simple program prints out only the string of characters Hello World. Why is it so important if it is so simple?? Well, the main purpose of this task is to get the ‘programmer’ familiar with main structure of the language.

I was bored and got together some Hello World application from the languages I can program in:

1. C

#include <stdlib.h>

void main()
{
printf(“Hello world!”);
}

2. C++

#include <iostream>
using namespace std;

int main()
{
cout << “Hello World” << endl;
return 0;
}

3. Java

public class helloWorld {
public static void main( String[] args )
{
System.out.println(“Hello World”);
}
}


4. PHP


<?php
echo 'Hello World!';
?>

5. Html

<html>
<head>
<title>Hello World</title>
</head>
<body>
Hello World!
</body>
</html>


6. Shell script


#!/bin/csh
echo “Hello World!”


How would you say 'Hello World!'??

No comments:

Post a Comment