Saturday, November 10, 2018

Looping - Variable Loop

Variable Loop
Eg.
A survey is carried out in a town. Information such as name, sex, age etc of each person is available. To maintain a list of people aged 50 and above in the town you draw a Flowchart as follows:


Figure illustrates a variable loop, as the exact number of people in town is not known. This loop continues till the name and age of the last person in the town is read. 
Loops are fixed if operations are repeated a fixed number of times  The values being computed or handled inside the loop have no effect on the number of times the looping operation is done.
Variable loops are the ones where the operations are repeated until a specified condition is met. The number of times the loop is repeated may vary. 


No comments:

Post a Comment