RosettaCodeData/Task/Loops-Do-while/Fortran/loops-do-while-2.f

16 lines
410 B
FortranFixed
Raw Permalink Normal View History

2013-04-10 21:29:02 -07:00
PROGRAM DOWHILE
C Initialize modulus and value.
INTEGER MODLUS, IVALUE
PARAMETER (MODLUS = 6)
IVALUE = 0
C FORTRAN 77 has no do-while structure -- not semantically. It is not
C difficult to simulate it using GOTO, however:
10 CONTINUE
IVALUE = IVALUE + 1
WRITE (*,*) IVALUE
IF (.NOT. (MOD(IVALUE, MODLUS) .EQ. 0)) GOTO 10
STOP
END