While Loop - Equivalent Constructs

Equivalent Constructs

while (condition) { statements; }

is equivalent to

if (condition) { do { statements; } while (condition); }

or

while (true) { if (!condition) break; statements; }

or

goto TEST; LOOPSTART: statements; TEST: if (condition) goto LOOPSTART;

or

TEST: if (!condition) goto LOOPEND; statements goto TEST; LOOPEND:

Also, in C and its descendants, a while loop is a for loop with no initialization or counting expressions, i.e.,

for ( ; condition; ) { statements; }

}

Read more about this topic:  While Loop

Famous quotes containing the words equivalent and/or constructs:

    I started off rapping for people just like myself, people who were in awe of wealth and flash. It was a conversation between me and them. But now most of those who buy my records are listening in on others’ conversation. They are the aural equivalent of voyeurs, thrilled at this crazy world that has nothing to do with their experience.
    Ice-T [Tracy Marrow], U.S. rap musician. Observer (London, Oct. 27, 1991)

    Psychology has nothing to say about what women are really like, what they need and what they want, essentially because psychology does not know.... this failure is not limited to women; rather, the kind of psychology that has addressed itself to how people act and who they are has failed to understand in the first place why people act the way they do, and certainly failed to understand what might make them act differently.
    Naomi Weisstein, U.S. psychologist, feminist, and author. Psychology Constructs the Female (1969)