Posted by: Taong Grasa | May 16, 2008

HELLO WORLD!

“Hello World!” program is the first program that programmers write when they starting to learn a new programming language. 

It’s like the “baby talk” of programmers every time they have to learn a new language… Below are some of the collections of

“Hello World!” programs from different programming languages.

ASP-JavaScript

Hello World for Microsoft ASP (in JavaScript)

<%@ language=”javascript” %>
<html><body>
<%
Response.Write(‘Hello World!’);
%>
</body></html>

==========================================================

ASP-VBS

Hello World for Microsoft ASP (in VBScript)

<%@ language=”vbscript” %>
<html><body>
<%
Response.write “Hello World!”
%>
</body></html>

==========================================================

Assembler-IBM-370

ITLE ‘Hello World for IBM Assembler/370 (VM/CMS)’
HELLO    START
BALR  12,0
USING *,12
*
WRTERM ‘Hello World!’
*
SR    15,15
BR    14
*
END   HELLO

==========================================================

Assembler-Intel

; Hello World for Intel Assembler (MSDOS)

mov ax,cs
mov ds,ax
mov ah,9
mov dx, offset Hello
int 21h
xor ax,ax
int 21h

Hello:
  db “Hello World!”,13,10,”$”

==========================================================

Assembler-Win32

; Hello world in Assembler for the Win32 architecture

TITLE Hello world in win32. Tasm

VERSION T310
Model use32 Flat,StdCall

start_code segment byte public ‘code’ use32
begin:
 Call MessageBox, 0, offset sHallo, offset caption, 0
 Call ExitProcess, 0
start_code Ends

start_data segment byte public ‘data’ use32

sHallo  db ‘Hello world’,0
caption db “Hi”,0

start_data Ends
End begin

==========================================================

BASIC

10 REM Hello World in BASIC
20 PRINT “Hello World!”

==========================================================

C#

// Hello World in Microsoft C# (“C-Sharp”).

using System;

class HelloWorld
{
    public static int Main(String[] args)
    {
        Console.WriteLine(“Hello, World!”);
        return 0;
    }
}

==========================================================

C++

// Hello World in C++ (pre-ISO)

#include <iostream.h>

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

==========================================================

C++-CLI

// Hello World in C++/CLI for .NET

using namespace System;

void main()
{
    Console::WriteLine(“Hello World”);
}

==========================================================

C++-ISO

// Hello World in ISO C++

#include <iostream>
#include <ostream>

int main()
{
    std::cout << “Hello World!” << std::endl;
}

==========================================================

C-ANSI

/* Hello World in C, Ansi-style */

#include <stdio.h>
#include <stdlib.h>

int main(void)
{
  puts(“Hello World!”);
  return EXIT_SUCCESS;
}

==========================================================

C-Windows

/* Hello world in C for MS-Windows */

#include <windows.h>

int PASCAL WinMain(HINSTANCE hInstance,
  HINSTANCE hPrevInstance, LPSTR CmdLine, int Show)
{
  MessageBox(GetActiveWindow(), “Hello World!”, “Hello Windows World”, MB_OK);
  return 0;
}

==========================================================

Clipper

// Hello World in Clipper (Summer 87, 5.0, 5.01, 5.2, 5.3)

? “Hello World”

==========================================================

Cobol

       * Hello World in Cobol

*****************************
IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO.
ENVIRONMENT DIVISION.
DATA DIVISION.
PROCEDURE DIVISION.
MAIN SECTION.
DISPLAY “Hello World!”
STOP RUN.
****************************

==========================================================

ColdFusion

<!—Hello world in ColdFusion—>

<cfset message = “Hello World”>
<cfoutput> #message#</cfoutput>

==========================================================

CSS

/* Hello World in CSS */
body:before {
    content: “Hello World”;
}

==========================================================

Darkbasic

` Hello World in Darkbasic

print “Hello World!”
wait key

==========================================================

dBase

* Hello World in dBase IV

? “Hello World!”

==========================================================

Delphi

// Hello World in Delphi
Program Hello_World;

{$APPTYPE CONSOLE}

Begin
  WriteLn(‘Hello World’);
End.

==========================================================

Fortran

C     Hello World in Fortran

      PROGRAM HELLO
      WRITE (*,100)
      STOP
  100 FORMAT (‘ Hello World! ‘ /)
      END

==========================================================

Java

// Hello World in Java

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

==========================================================

Java-Mobile

// Hello World on a mobile Java device

package helloworld;

import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;

public class HelloWorld extends MIDlet {

  public HelloWorld()
  {
    Form form = new Form(“Hello World”);
    form.append(“Hello world!”);
    Display.getDisplay(this).setCurrent(form);
  }

  protected void pauseApp() {  }
  protected void startApp() throws
    javax.microedition.midlet.MIDletStateChangeException {  }
  protected void destroyApp(boolean parm1) throws
    javax.microedition.midlet.MIDletStateChangeException {  }
}

==========================================================

Java-Server-Pages

<!– Hello World for Java Server Pages –>

<%@ page language=’java’ %>
<%=”Hello World!” %>

==========================================================

Java-Servlet

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;

//
// Hello World Java Servlet
//
public class HelloWorld extends HttpServlet {
public void service(HttpServletRequest request,
HttpServletResponse response)
throws IOException {

response.setContentType(“text/html”);
PrintWriter out = response.getWriter();

out.println(“<html><body>”);
out.println(“Hello World!”);
out.println(“</body></html>”);
}
}

==========================================================

Java-Swing

// Hello World in Java using Swing GUI

class HelloWorldSwing {
  static public void main(String args[]) {
    javax.swing.JOptionPane.showMessageDialog(null,”Hello world!”);
  }
}

==========================================================

JavaScript

<html>
<body>
<script language=”JavaScript” type=”text/javascript”>
// Hello World in JavaScript
document.write(‘Hello World’);
</script>
</body>
</html>

==========================================================

OpenVMS

$! Hello World in OpenVMS DCL

$ write sys$output “Hello World”

==========================================================

Pascal

{Hello World in Pascal}

program HelloWorld(output);
begin
  WriteLn(‘Hello World!’);
end.

==========================================================

Pascal-Windows

{ Hello World in Borland Pascal 7 for MS-Windows}

PROGRAM HelloWorld;

USES
  WinCRT;

BEGIN
  InitWinCRT;
  WriteLn(‘Hello World!’);
  ReadLn;
  DoneWinCRT;
END.

==========================================================

Perl

# Hello world in perl

print “Hello World!\n”;

==========================================================

PHP

<?php
  // Hello World in PHP
  echo ‘Hello World!’;
?>

==========================================================

PL-SQL

— Hello World in Oracle PL/SQL (sqlplus)

set serveroutput on

begin
  dbms_output.enable(10000);
  dbms_output.put_line(‘Hello World’);
end;
/

==========================================================

PL1

/* Hello World in PL/1 */

Hello: procedure options(main);
       put skip list(‘Hello World!’);
end Hello;

==========================================================

Progress

/* Hello World in Progress */

message “Hello World” view-as alert-box.

==========================================================

Prolog

% Hello World in Prolog

hello :- display(‘Hello World!’) , nl .

==========================================================

REALbasic

‘ Hello World in REALbasic (http://www.realsoftware.com/)

msgBox “Hello World!”

==========================================================

Ruby

# Hello World in Ruby
puts “Hello World!”

==========================================================

T-SQL

— Hello World in T-SQL
PRINT ‘Hello World’

==========================================================

Visual-FoxPro

*Hello World in Microsoft Visual FoxPro 5-9
? “Hello World!”

==========================================================

VisualBasic.NET

‘Hello World in Visual Basic .NET (VB.NET)

Imports System.Console

Class HelloWorld

    Public Shared Sub Main()
        WriteLine(“Hello, world!”)
    End Sub

End Class

==========================================================

VisualBasic6

‘ Hello World in Visual Basic 6

Private Sub Form_Load()
Print “Hello World”
End Sub


Responses

  1. wow! the famous Hello World. haha. ^_^

    when i was doing my first program, i usually use “Hi World”. just for a change. harhar. ^^,

    btw, blog hoppin. hope to see you in my blog house. tc!😉

  2. […] talk??? of programmers every time they have to learn a new language?? Below are some of the collechttps://taonggrasa.wordpress.com/2008/05/16/hello-world/sqlplus set commandc|OFF|ON} Set the non-alphanumeric character used to end PL/SQL blocks … to […]


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

Categories

%d bloggers like this: