Do Loop
For basic looping, Fortran provides a flexible construct called the do-loop:
Specifying the loop_increment
is optional, and it may be omitted if equal to 1. If loop_increment
is present, it may be positive or negative (for counting down). Here are examples with different increments:
To go along with its simple do-loop, Fortran provides a do-while construct, allowing for more complex exit conditions.
©
2025
|
Cornell University
|
Center for Advanced Computing
|
Copyright Statement
|
Access Statement
CVW material development is supported by NSF OAC awards 1854828, 2321040, 2323116 (UT Austin) and 2005506 (Indiana University)
CVW material development is supported by NSF OAC awards 1854828, 2321040, 2323116 (UT Austin) and 2005506 (Indiana University)