Pascal's repeat... until vs. C's do... while

Posted by Bob on Stack Overflow See other posts from Stack Overflow or by Bob
Published on 2010-06-01T23:09:40Z Indexed on 2010/06/01 23:13 UTC
Read the original article Hit count: 272

Filed under:
|
|
|

In C there is a do while loop and pascal's (almost) equivalent is the repeat until loop, but there is a small difference between the two, while both structures will iterate at least once and check whether they need to do the loop again only in the end, in pascal you write the condition that need to met to terminate the loop (REPEAT UNTIL something) in C you write the condition that need to be met to continue the loop (DO WHILE something). Is there a reason why there is this difference or is it just an arbitrary decision?

© Stack Overflow or respective owner

Related posts about c

    Related posts about syntax