We can give any reasonable name to an algorithm module.
We will use lowercase for variable name.
For initializing variable we will use the word Set
Set score = 0;
Set x = 0, y = 0, score = 0, isGameOver = false;
Data may be input and assigned to variable using Read statement.
Read: variable list
Read: x, y, z;
Message and data in variables may be output by using Write or Print statement.
Write: Message and/or variable list
Print: Message and/or variable list
Write: “Hello World”; //message
Print: “Value of x = ”, x; //message and variable
Algorithm will start with a Begin statement and will end with an End statement.
Algorithm is completed with the execution of the last instruction.
However, we can terminate the execution at any stage using Exit instruction.
We generally divide complex problem into small manageable sub problems and then we develop algorithm for each of the sub problems, called sub algorithm.
We will use the Call statement to call any algorithm module from another module.
Have fun learning :-)
Copyright © 2014 - 2019 DYclassroom. All rights reserved.
rendered in 0.0155 sec