© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2021
R. VystavělC# Programming for Absolute Beginnershttps://doi.org/10.1007/978-1-4842-7147-6_23

23. Unknown Number of Repetitions

Radek Vystavěl1  
(1)
Ondřejov, Czech Republic
 

In all the loops you have solved so far, you knew the number of iterations. Sometimes, you do not know it when writing a program, simply because the user is supposed to enter it. However, in all the cases, when a loop started, it had already been determined how many times it would iterate.

Sometimes, the number of repetitions is not known at the moment a loop starts executing. Frequently, you will be concerned with the question of whether a loop should go on or terminate.

Entering a Password ...

Get C# Programming for Absolute Beginners: Learn to Think Like a Programmer and Start Writing Code now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.