Xref: utzoo comp.lang.modula2:1221 comp.lang.c:15836 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!tank!mimsy!haven!aplcen!arrom From: arrom@aplcen.apl.jhu.edu (Ken Arromdee) Newsgroups: comp.lang.modula2,comp.lang.c Subject: Re: "for" loops (was Re: C++ vs. Modula2) Message-ID: <608@aplcen.apl.jhu.edu> Date: 28 Jan 89 00:11:29 GMT References: <739@jupiter.iis.UUCP> <1611@csuna.UUCP> Reply-To: arrom@aplcen.apl.jhu.edu (Ken Arromdee (600.429)) Followup-To: comp.lang.modula2 Organization: Johns Hopkins University Lines: 15 >Actually, C's "for" can be duplicated EXACTLY by C's "do ... while" loops. I suspect you're going to get an awful lot of flames for saying this. What about for(i=0; i<=j; i++) printf("%d\n",i); Since a do-while loop has the test condition at the termination of the loop, it is not possible to produce an equivalent do-while version, for the behavior will differ if j is less than 0. -- EARTH --Kenneth Arromdee smog | bricks UUCP: ....!jhunix!ins_akaa AIR mud FIRE INTERNET: arromdee@crabcake.cs.jhu.edu soda water | tequila BITNET: g49i0188@jhuvm WATER (please, no mail to arrom@aplcen)