Consider situation (2) next. Since the number of marks will be known when the program is executed it is once again possible to use a for loop as can be seen below:
1. The number of times that the for loop will be executed will depend on the value which is entered for the number of students when the program is run.
2. The number of students entered is used in the calculation of the average.