Hello world

Dari Wikipedia bahasa Indonesia, ensiklopedia bebas
Loncat ke navigasi Loncat ke pencarian

Hello world (Halo dunia) adalah nama jenis program komputer yang diambil pertama kalinya saat memulai pemrograman.

Program ini sangat sederhana dengan menunjukkan teks "Hello world" di layar. Contoh awal ini dipakai untuk menulis program-program yang lebih canggih.

Hello world! pertama kalinya dipakai oleh para pemrogram bahasa C untuk menunjukkan kemampuan bahasa ini.

Hello world dalam beberapa bahasa pemrograman[sunting | sunting sumber]

Basic[sunting | sunting sumber]

 10 PRINT "Hello world"

File Batch[sunting | sunting sumber]

@echo off
echo Hello world

C[sunting | sunting sumber]

  #include <stdio.h>
  
  int main()
  {
     printf("Hello world\n");
     return 0;
  }

C++[sunting | sunting sumber]

  #include <iostream>
  int main()
  {
     std::cout << "Hello world";
     return 0;
  }

C#[sunting | sunting sumber]

  class HaloDunia
  {
        static void main( )
        {
           System.Console.WriteLine("Halo Dunia");
        }
  }

Delphi[sunting | sunting sumber]

program HaloDunia;

{$APPTYPE CONSOLE}

uses
  SysUtils;

begin
  writeln('Halo Dunia');
end.

Clipper[sunting | sunting sumber]

 ?"Hello world"

Java[sunting | sunting sumber]

  public class HaloDunia {  
     public static void main(String args[]) {
        System.out.println("Hello world\n");
     }

lisp[sunting | sunting sumber]

 (print "Hello world")

Pascal[sunting | sunting sumber]

 program helloworld;
 begin {
    writeln('halo dunia');
 }
 end.

Perl[sunting | sunting sumber]

  print "Hello world\n";

PHP[sunting | sunting sumber]

 <?php
 echo "Hello world";
 ?>

PL/SQL Oracle[sunting | sunting sumber]

 create or replace procedure HelloWorld is
 begin
     dbms_out.put_line('HALO DUNIA');
 end;

Prolog[sunting | sunting sumber]

 write('Hello world'),nl.

Python[sunting | sunting sumber]

 print 'Hello world\n'

RPG[sunting | sunting sumber]

    I              'Hello world'          C         HELLO
    C                     DSPLY          HELLO

Seed7[sunting | sunting sumber]

$ include "seed7_05.s7i";

 const proc: main is func
   begin
     writeln("Hello world");
   end func;

Microsoft T-SQL[sunting | sunting sumber]

 create proc HelloWorld as
 begin
     print 'HALO DUNIA'
 end

Hello world dalam beberapa bahasa shell[sunting | sunting sumber]

Bash[sunting | sunting sumber]

  printf "Hello world"

Sh[sunting | sunting sumber]

 echo 'Hello world'

Hello world dalam beberapa bahasa mark up[sunting | sunting sumber]

HTML[sunting | sunting sumber]

<pre>
 <html>
    <head>
       <title>
          Halo Dunia
       </title>
    </head>
    <body>
       Hello world
    </body>
 </html>
</pre>

LaTeX[sunting | sunting sumber]

 \documentclass{article}
 \begin{document}
   Hello world
 \end{document}

Lisp[sunting | sunting sumber]

  (princ "Hello world\n")
  (prin1)

XML[sunting | sunting sumber]

 <?xml version="1.0"?>
 <text>Hello world</text>

Pranala luar[sunting | sunting sumber]