Hello world

Dari Wikipedia bahasa Indonesia, ensiklopedia bebas
Langsung ke: navigasi, cari

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

Program ini sangat sederhana dengan menunjukkan teks "Halo dunia" 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 "Halo dunia"

File Batch[sunting | sunting sumber]

@echo off
echo Halo dunia

C[sunting | sunting sumber]

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

C++[sunting | sunting sumber]

  #include <iostream>
  int main()
  {
     std::cout << "Halo dunia";
     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]

 ?"Halo dunia"

Java[sunting | sunting sumber]

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

lisp[sunting | sunting sumber]

 (print "Halo dunia")

Pascal[sunting | sunting sumber]

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

Perl[sunting | sunting sumber]

  print "Halo dunia\n";

PHP[sunting | sunting sumber]

 <?php
 echo "Halo dunia";
 ?>

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('Halo dunia'),nl.

Python[sunting | sunting sumber]

 print 'Halo dunia\n'

RPG[sunting | sunting sumber]

    I              'Halo dunia'          C         HELLO
    C                     DSPLY          HELLO

Seed7[sunting | sunting sumber]

$ include "seed7_05.s7i";

 const proc: main is func
   begin
     writeln("Halo dunia");
   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 "Halo dunia"

Sh[sunting | sunting sumber]

 echo 'Halo dunia'

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

HTML[sunting | sunting sumber]

<pre>
 <html>
    <head>
       <title>
          Halo Dunia
       </title>
    </head>
    <body>
       Halo dunia
    </body>
 </html>
</pre>

LaTeX[sunting | sunting sumber]

 \documentclass{article}
 \begin{document}
   Halo dunia
 \end{document}

Lisp[sunting | sunting sumber]

  (princ "Halo dunia\n")
  (prin1)

XML[sunting | sunting sumber]

 <?xml version="1.0"?>
 <tekst>Halo dunia</tekst>

Pranala luar[sunting | sunting sumber]