Professional Documents
Culture Documents
Desk Check Example - Modules
Desk Check Example - Modules
Desk Check Example - Modules
The following example shows desk checking involving a sub-algorithm aka module.
When a sub-algorithm is called, processing goes from the calling line (module call e.g. line 3 in
this example) to the first line in the sub-algorithm (e.g. line 6). The sub-algorithm is then
executed, and when the end of the sub-algorithm is reached (e.g. line 14), execution goes back to
the line after where it was originally called (e.g. line 4).
1 Algorithm compareNumbers()
2 Input number1, number2, number3
3 smallest= getSmallestNumber(number1, number2, number3)
4 Display smallest
5 Halt
Desk Check
1
13
14
3 3
4 smallest = 3
5