c FORTRAN 77 code
c This program does division using an IF-THEN-ELSE structure.
PROGRAM divide
REAL dividend, divisor, quotient
c Prompt for and enter dividend and divisor.
PRINT *, 'Enter two numbers.'
PRINT *, 'The first number is the dividend, the second the divisor.'
READ *, dividend, divisor
c Check to see if divisor is 0.
IF (divisor .eq. 0.0) THEN
PRINT *, 'The division is undefined (the divisor is zero).'
STOP
c If divisor is not 0 do division.
ELSE
quotient=dividend/divisor
c Print results.
PRINT *, 'The quotient of the two numbers is ', quotient
ENDIF
END