Skip to main content

4.8) Understanding Decisions In Fortran (cont'd)


In Example 8, if the test on line 6 is not true, however, then the program will skip going into that part of the if statement on line 7 and it will go to the next test on line 8. An else statement is always performed (if it is reached) since there is no test to be evaluated, so it will go to line 9 and print the suggestion to increase a. It will then proceed to line 10 and continue in the program. Please view the video to see this explained further.

Explains how to do a basic 'if' and 'else' statement.