Saying “Hello World” in Multiple Computer Languages

sql server

When learning a computer programming language, usually the first exercise is showing the student how to output “Hello World” to the screen. This has been a tradition for many years. The similarity of the exercise code helps someone who is familiar with one language see the differences in getting the same output in a new language.

Here are some examples:

ASP.Net

Response.Write("Hello World!");

AWK

BEGIN { print "Hello World!" }

Bash

echo "Hello World!"

BASIC

PRINT "Hello World!"

C

#include <stdio.h>
int main()
{
    printf("Hello World!\n");
}

C#

using System;
class Program
{
    public static void Main(string[] args)
    {
        Console.WriteLine("Hello World!");
    }
}

COBOL

IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO-WORLD.
PROCEDURE DIVISION.
DISPLAY 'Hello World!'.
STOP RUN.

Dart

main() {
  print('Hello World!');
}

HTML

<!DOCTYPE html>
<html>
   <head></head>
   <body>
       <p>Hello World!</p>
   </body>
</html>

Java

public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello World!");
    }
}

Mathematica

Print["Hello World!"]

Transact-SQL

SELECT 'Hello World!';

If you are interested in learning more on this subject, you can read this article.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s