Skip to content

Commit

Permalink
Fixed code example, added output
Browse files Browse the repository at this point in the history
  • Loading branch information
StanislavRadkov committed Feb 9, 2015
1 parent b8957fe commit 9cdc923
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -352,14 +352,21 @@ Output:

Example of a do while loop:
```fortran
integer:: i = 1, n = 5
integer:: i = 1, n = 3
do while (i <= n)
write (*, *) i
write(*,*) "i = ", i
i = i + 1
enddo
```

Output:
```fortran
i = 1
i = 2
i = 3
```

Implied DO loops are DO loops in the sense that they control the execution of some iterative procedure, but are different than DO loops because they do not use the do statement to control the execution. Basically, these loops are a shorthand that was introduced in FORTRAN to provide a method for array initialization and to cut back on the number of lines of code that where required in the program. Example:

```fortran
Expand Down

0 comments on commit 9cdc923

Please sign in to comment.