A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
17
Task/Loops-Infinite/Fortran/loops-infinite-1.f
Normal file
17
Task/Loops-Infinite/Fortran/loops-infinite-1.f
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
PROGRAM INFINITELOOP
|
||||
C While you can put this label on the WRITE statement, it is good
|
||||
C form to label CONTINUE statements whenever possible, rather than
|
||||
C statements that actually contain instructions. This way, you can
|
||||
C indent inside the "loop" and make it more readable.
|
||||
10 CONTINUE
|
||||
WRITE (*,*) 'SPAM'
|
||||
GOTO 10
|
||||
|
||||
C It is also good form to close the "loop" with another label. In
|
||||
C this case, there is absolutely no reason to do this at all, but,
|
||||
C if you wanted to break, you would be able to add `GOTO 20` to
|
||||
C exit the loop.
|
||||
20 CONTINUE
|
||||
|
||||
STOP
|
||||
END
|
||||
3
Task/Loops-Infinite/Fortran/loops-infinite-2.f
Normal file
3
Task/Loops-Infinite/Fortran/loops-infinite-2.f
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
DO
|
||||
WRITE(*,*) "SPAM"
|
||||
END DO
|
||||
2
Task/Loops-Infinite/Fortran/loops-infinite-3.f
Normal file
2
Task/Loops-Infinite/Fortran/loops-infinite-3.f
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
10 WRITE(*,*) "SPAM"
|
||||
GOTO 10
|
||||
Loading…
Add table
Add a link
Reference in a new issue