User:Siebengang/Workbench/Hello, world!

From Wikibooks, open books for an open world
Jump to: navigation, search

Python[edit]

# Hello World in Python
print "Hello, world!"

Perl[edit]

# Hello World in Perl
print "Hello World!";

PHP[edit]

<?php
    // Hello World in PHP
    echo 'Hello, world!';
?>

C[edit]

/* Hello World in Ansi-C */
#include <stdio.h>
int main()
{
    printf("Hello, World!\n");
    return 0;
}

C++[edit]

// Hello World in C++
#include <iostream>
int main()
{
    std::cout << "Hello, World!" << std::endl;
    return 0;
}

C#[edit]

// Hello World in Microsoft C#
using System;
class HelloWorld
{
    public static int Main(String[] args)
    {
        Console.WriteLine("Hello, World!");
        return 0;
    }
}

Fortran 77[edit]

C     Hello World in Fortran 77
      PROGRAM HELLO
      PRINT*, 'Hello World!'
      END

Java[edit]

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

Pascal[edit]

{Hello World in Pascal}
program HelloWorld(output);
begin
  WriteLn('Hello World!');
end.

Basic[edit]

10 REM Hello World in BASIC
20 PRINT "Hello World!"