The question was clearly phrased; it was made clear to the student what should be the final result.
I would like to suggest the following points to be considered by the author of the question, in order to support deeper learning.
Challange the program with different inputs, and write test code.
Challange the author of the code to implement by using two different code languages (distinict by nature: as R/Python/Matlab vs. Iterative code as C/C++/C#), the student will be able to contemplate over the strengths of each language in the domain.
another thing- it is possible to use this kind of programing-based problem solving and connect it to our everyday lives. for example, make this program more general instead of the specific 1-100 avg, where the user could input any value they prefer - and thus making this program more approachable to many everyday tasks we encounter- such as averaging our bills, salaries and so on, making small daily inconveniences simpler on the one hand, and more thought provoking on the other.