do loop

Quick Reference

A counting loop in a program, in which a section of code is obeyed repeatedly with a counter taking successive values. Thus in Fortran,causes the 〈statements〉 to be obeyed 100 times. The current value of the counter variable is often used within the loop, especially to index an array. There are many syntactic variants: in Pascal and Algol-like languages the same basic construct appears as the for loop, e.g.This kind of loop is a constituent of almost all programming languages (except APL, which has array operations defined as operators in the language).

See also do-while loop.

Subjects: Computing.

Reference entries