FORTRAN Reference Manual

Statements
FORTRAN Reference Manual528615-001
7-61
IF Statement—Block
You can use an ELSE statement to specify a group of statements to execute if the
initial condition is false:
IF (loan type .EQ. 'consumer') THEN
rate = normal rate
premium = 1000
ELSE
rate = normal rate * .9
premium = 500
END IF
If more than two conditions must be considered, you can use ELSE IF statements,
each followed by an if-block:
IF(loan type .EQ. 'A') THEN
rate = normal rate
premium = 1000
ELSE IF (loan type .EQ. 'B') THEN
rate = normal rate * .9
premium = 500
ELSE IF (loan type .EQ. 'C') THEN
rate = normal rate * .85
premium = 100
END IF