09.10.2014 Views

download pascal tutorial (pdf - Tutorials Point

download pascal tutorial (pdf - Tutorials Point

download pascal tutorial (pdf - Tutorials Point

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Example: .................................................................................................. 50<br />

Loop Control Statements: ........................................................................ 52<br />

Syntax: ..................................................................................................... 52<br />

Flow Diagram: .......................................................................................... 52<br />

Example: .................................................................................................. 53<br />

Syntax: ..................................................................................................... 54<br />

Flow Diagram: .......................................................................................... 54<br />

Example: .................................................................................................. 55<br />

Syntax: ..................................................................................................... 56<br />

Flow Diagram: .......................................................................................... 56<br />

Example: .................................................................................................. 57<br />

Functions ............................................................................... 58<br />

Subprograms ........................................................................................... 58<br />

Functions ................................................................................................. 58<br />

Defining a Function: ................................................................................. 59<br />

Function Declarations: ............................................................................. 60<br />

Procedure .............................................................................. 62<br />

Defining a Procedure: .............................................................................. 62<br />

Procedure Declarations: .......................................................................... 63<br />

Calling a Procedure: ................................................................................ 63<br />

Recursive Subprograms .......................................................................... 64<br />

Arguments of a Subprogram: ..................................................................... 66<br />

Variable Scope ....................................................................... 70<br />

Local Variables ........................................................................................ 70<br />

Global Variables ........................................................................................ 71<br />

Strings .................................................................................... 74<br />

Examples ................................................................................................. 74<br />

Pascal String Functions and Procedures ................................................. 76<br />

Boolean .................................................................................. 79<br />

Declaration of Boolean Data Types ......................................................... 79<br />

Example: .................................................................................................. 80<br />

Arrays..................................................................................... 81<br />

Declaring Arrays ...................................................................................... 81<br />

Types of Array Subscript ......................................................................... 82<br />

Initializing Arrays ...................................................................................... 83<br />

Accessing Array Elements ....................................................................... 83<br />

Pascal Arrays in Detail ............................................................................. 84<br />

Two-Dimensional Arrays: ......................................................................... 85<br />

Initializing Two-Dimensional Arrays: ........................................................ 85<br />

iii

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!