24.11.2014 Views

Open Watcom FORTRAN 77 Language Reference

Open Watcom FORTRAN 77 Language Reference

Open Watcom FORTRAN 77 Language Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>FORTRAN</strong> Statements<br />

2.38 END WHILE Statement<br />

END WHILE<br />

The END WHILE statement is used in conjunction with the structured WHILE statement. The END<br />

WHILE statement marks the end of a sequence of statements which are to be repeated. The WHILE<br />

statement marks the beginning of the WHILE-block. The WHILE-block is executed while the logical<br />

expression (or integer arithmetic expression) of the WHILE statement has a true (or non-zero) value or until<br />

control is transferred out of the WHILE-block.<br />

Example:<br />

Example:<br />

X = 1.0<br />

WHILE( X .LT. 100 )DO<br />

PRINT *, X, SQRT( X )<br />

X = X + 1.0<br />

END WHILE<br />

I = 10<br />

WHILE( I )DO<br />

PRINT *, I<br />

I = I - 1<br />

ENDWHILE<br />

END<br />

For more information, see the chapter entitled "Program Structure Control Statements" on page 193.<br />

END WHILE Statement 69

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!