PresidenT AnaS Posted November 23, 2016 Share Posted November 23, 2016 Today we have new type of Pascal which is called "Hello world". Before we study basic building blocks of the Pascal programming language, let us look a bare minimum Pascal program structure so that we can take it as a reference in upcoming chapters. Pascal Program Structure: A Pascal program basically consists of the following parts − 1| Program name 2| Uses command 3| Type declarations 4| Constant declarations 5| Variables declarations 6| Functions declarations 7| Procedures declarations 8| Main program block 9| Statements and Expressions within each block 10| Comments Every pascal program generally has a heading statement, a declaration and an execution part strictly in that order. Following format shows the basic syntax for a Pascal program − program {name of the program}uses {comma delimited names of libraries you use}const {global constant declaration block}var {global variable declaration block}function {function declarations, if any}{ local variables }begin...end;procedure { procedure declarations, if any}{ local variables }begin...end;begin { main program block starts}...end. { the end of main program block } Pascal Hello World Example Following is a simple pascal code that would print the words "Hello, World!": program HelloWorld; uses crt;(* Here the main program block starts *)beginwriteln('Hello, World!');readkey;end. This will produce following result − Hello, World! Link to comment Share on other sites More sharing options...
PresidenT AnaS Posted November 26, 2016 Author Share Posted November 26, 2016 TC Link to comment Share on other sites More sharing options...
Recommended Posts