Hello world program

Hello world je prvi program koji se pravi na evropskim fakultetima. To je najčešće jedan od prvih programa koje naprave programeri početnici u cilju upoznavanja sa osnovama programerskih vještina.

Ovaj program obično ispisuje poruku ("Hello world", tj. "Pozdrav svijete") na osnovni izlaz (output) pri izvršavanju.

Implementacija u raznim programskim jezicimaUredi

AdaUredi

with TEXT_IO;
procedure HELLO is
begin
  TEXT_IO.PUT_LINE ("Hello world!");
end HELLO;

ASPUredi

'Hello world!'

BASICUredi

PRINT "Hello World!"

CUredi

#include <stdio.h>

int main()
{
  printf("Hello, world!\n");
  return 0;
}

C++Uredi

#include <iostream>

using namespace std;

int main()
{
  cout << "Hello, world!" << endl;
  return 0;
}

C♯Uredi

using System;

class HelloWorld
{
  static void Main()
  {
    Console.WriteLine("Hello World");
    Console.ReadLine();
  }
}

COBOLUredi

        IDENTIFICATION DIVISION.
          Program-Id. Hello-World.
       *
        ENVIRONMENT DIVISION.
       *
        DATA DIVISION.
       *
        PROCEDURE DIVISION.
        Para1.
            DISPLAY "Hello, world.".
       *
            Stop Run.

FortranUredi

C     Hello World u Fortran-u

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

JavaUredi

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

PascalUredi

 program Hello (output);
 
 begin
     writeln ('Hello, world!');
 end.

PerlUredi

 print "Hello, world!\n";

ili

 package Hello;
 sub new() { bless {} }
 sub Hello() { print "Hello, World! \n" }
 package main;
 my $hello == new Hello;
 $hello->Hello();

PythonUredi

print("Hello, world!")

Seed7Uredi

 $ include "seed7_05.s7i";
 
 const proc: main is func
   begin
     writeln("Hello, world!");
   end func;

Vanjski linkoviUredi