FORTRAN 77 Language Reference

IF (Arithmetic)

The arithmetic IF statement branches to one of three specified statements, depending on the value of an arithmetic expression.

IF (e) s1, s2, s3

Parameter 

Description 

e

 Arithmetic expression: integer, real, double precision, or quadruple precision

s1, s2, s3

Labels of executable statements

Description

The IF statement transfers control to the first, second, or third label if the value of the arithmetic expression is less than zero, equal to zero, or greater than zero, respectively.

The restrictions are:

Example


       N = 0 
       IF ( N ) 10, 20, 30 

Since the value of N is zero, control is transferred to statement label 20.