Hangi programlama dilini öğrenmeye kalkarsanız kalkın ilk öğreneceğiniz şey ekrana Hello World ya da Merhaba Dünya yazdırmak olacaktır.
Şimdi aşağıda bazı programlama dillerine ait Hello World yazdırma şekillerini göstereceğim. Amacım hem programlama dillerinin basit yapısını göstermek hemde yeni başlayacaklar için bir ön bilgi oluşturmak.
C#
class HelloWorld
{
static void Main()
{
System.Console.WriteLine(“Hello, World!”);
}
}
C++
#include <iostream.h>
main()
{
cout << “Hello World!” << endl;
return 0;
}
Delphi
Program Hello_World;
{$APPTYPE CONSOLE}
Begin
WriteLn(‘Hello World’);
End.
Fortran
PROGRAM HELLO
WRITE (*,100)
STOP
100 FORMAT (‘ Hello World! ‘ /)
END
HTML
<HTML>
<!– Hello World in HTML –>
<HEAD>
<TITLE>Hello World!</TITLE>
</HEAD>
<BODY>
Hello World!
</BODY>
</HTML>
JAVA
class HelloWorld {
static public void main( String args[] ) {
System.out.println( “Hello World!” );
}
}
JavaScript
<html>
<body>// Hello World in JavaScript
document.write(‘Hello World’);</body>
</html>
Pascal
{Hello World in Pascal}
program HelloWorld(output);
begin
WriteLn(‘Hello World!’);
end.
Perl
# Hello world in perl
print “Hello World!\n”;
Prolog
% Hello World in Prolog
hello :- display(‘Hello World!’) , nl .
Python 2
print “Hello World”
Python 3
print(“Hello World”)
Ruby
# Hello World in Ruby
puts “Hello World!”
Visual Basic
REM Hello World in Visual Basic for Windows
VERSION 2.00
Begin Form Form1
Caption = “Form1”
ClientHeight = 6096
ClientLeft = 936
ClientTop = 1572
ClientWidth = 6468
Height = 6540
Left = 876
LinkTopic = “Form1”
ScaleHeight = 6096
ScaleWidth = 6468
Top = 1188
Width = 6588
Begin Label Label1
Caption = “Hello World!”
Height = 372
Left = 2760
TabIndex = 0
Top = 2880
Width = 972
End
End
Option Explicit