Friday, October 12, 2007

How to work with FUNCTION

How to work with FUNCTION

To work with FUNCTION

Step 1

Description:

The function is a subprogram called form within an expression that returns a value through the function name.

Declaration:

function ident (parameters) : type;

Example:

function sumofsquares(n: integer): integer;

Edited By: Norasyikin Mahmud
© 2001 ISC
All rights reserved. All other product names and trademarks are registered properties of their respective owners.

051101

How to work with Boolean operators

How to work with Boolean operators

To work with Boolean operators

Step 1

Description:

Boolean operators are the special operators are use to combine Boolean expressions;

Declaration:

Operator Operation

not negation

and logical and

or logical or

xor logical xor

Example:

if (player1 > player2) or (player1 >= player2) then

Writeln(' The winner is player 1');

if (player1 <>

Writeln(' The winner is player 2');

How to work with relational operators

How to work with relational operators

To work with relational operators

Step 1

Description:

A sequence of identifiers, separated by compatible operators, that evaluates to TRUE or FALSE

Declaration:

Operator Operation

= Equal

Not equal

<>

Greater than

<= Less or equal

>= Greater or equal

Example:

if player1 > player2 then

Writeln(' The winner is player 1');

if player1 <>

Writeln(' The winner is player 2');

if player1 = player2 then

Writeln(' No winner in this game ');

How to work with Binary Arithmetic Operators

How to work with Binary Arithmetic Operators

To work with Binary Arithmetic Operators

Step 1

Description:

Arithmetic operators, which take real or integer operands, include +, –, *, /, div, and mod.

Declaration:

Operator Operation

+ Addition

Subtraction

Multiplication

/ Division

div Integer division

mod remainder

Example:

Writeln('Answer is : ',a+b+c);

Writeln('Answer is : ',a*b*c);

Writeln('Answer is : ',a+b-c);