ABSTRACT

An expression in an algorithm is built using constants and variables. Statements are composed of expressions and are the main units of executions. Statements can be mainly of three types; an assignment, a control or a repetition statement. An assignment assigns a value to a variable as follows:

int a ← 12

Here, we declare a variable of type integer and initialize it with the value 12. In order to branch within an algorithm, the if condition, then statement1, else statement 2 structure can be used, where condition is a Boolean expression which either evaluates to true or f alse. If the result of the evaluation is true, statement1 is executed, otherwise execution resumes with statement 2.