Saturday, January 17, 2009

How to make "Hello Word" Program

Let us start with the smallest Pascal program, which is shown in the following example.

It displays on your screen the phrase “Hello World!”

{ ----------------------------- Smallest Programs Example ----------------------------- }

PROGRAM Hello_World;

BEGIN

WRITELN(’Hello World!’)

END.

{ ---------------------------------------------------------------------- }

Whether the Pascal program is small or large, it must have a specific structure. This

program consists mainly of one statement, WRITELN, which does the actual work

here, as it displays whatever comes between the parentheses. The statement is

included inside a frame starting with the keyword BEGIN and ending with the keyword

END. This is called the program main body (or the program block) and usually

contains the main logic of data processing. The Pascal program may also contain other

building blocks called procedures and functions, which are explained in the other article.