Kamis, 18 Desember 2008

Display "Hallo World" with Pascal Language

The very simple program of Pascal Programming. This program will display "Hallo World" and waiting input from user.

Program Lesson1_Program1; {Program caption}
Begin {no semicolon}
Write ('Hallo World');
Readln; {waitting from input user}
End.

After we run this program it will be give an output:

Hallo World

and waiting input from user.

Note : this syntax can be copy and paste to the notepad or

other text editor and save it with extention .pas (eg:

HalloWorld.pas)

Program
Folowing the title of the program.

Write()
Function to display the statemant ('Hallo World' in this case). If we want to display and the pointer go to the next line we can use Writeln().

Readln;
Waiting for user input.

{...}
A comment line. If we run the program it will be ignore it.

; (semicolon)
End every function which we are write before.

End.
Close the body of program when start with begin.


Other process of writting of this syntax:

Program Lesson1_Program2;begin
Write('Hallo World');Readln;End

This program also runs perfectly as the previous one. The only dfference is neatness and friendliness.

Tidak ada komentar: