Computer Science, asked by kavitaburbure99, 5 days ago


In a FOR...NEXT loop, the variable controls the number of times the loop is executed

Answers

Answered by lokeshranjan08
1

Answer:

It is quite unusual to keep track of the number of times a particular instruction is executed in a loop. It is far more common to keep track of the times the set of instructions in the body of a loop are executed.

In your question you do not specify which programming language you want to know about, and the answer to a question about keeping track of loop iterations differs for different programming languages and different kinds of loops.

Many programming languages classify loops as either conditional loops or iterative loops.

Conditional loops continue executing until a controlling condition is encountered. Iterative loops execute a specified number of times. Some languages have a variation on iterative loops. Those loops are sometimes called a “for each” loop because they loop through the elements of a data container, executing some set of instructions on each element of the container. The “for each” loop does not usually expose any loop counter to the programmer.

While different languages implement different syntax for loops, the basic concepts are very similar across languages.

Similar questions