Program looping is the repetition of a block of code a specified number of times. The number of times the block of code is repeated may be well defined or based on a conditional statement. All computer languages contain looping structures because these structures are excellent at solving problems that would otherwise require repetitive code. Imagine a program whose function it is to search for a specific name in a column of data with one hundred entries. A program with one hundred If/Then statements testing the value of each cell for the required name will solve the problem. The program would be technically easy to create, but cumbersome to type the repetitive code and it would look awful. Fortunately, we have looping code structures to help us.
Each execution of the block of code inside a Looping structure represents one iteration of the loop.
Was this article helpful?