Previous topic |
Next topic |
Ada Home Page |
Index
Common loop applications
Important components of any loop are:
- before the loop, initialise the variable used for termination
- update variable appropriately inside loop
A common requirement
of a loop is to
accumulate a sum or product.
- must initialise variable with sum or product outside loop
- update variable appropriately inside loop
Another common task
is to look for special cases
Another common problem
is to
display a table
- must display heading outside loop, suitably spaced
- then display values inside loop with correct formatting
Previous topic |
Next topic |
Ada Home Page |
Index
c-lokan@adfa.oz.au / 14 Feb 96