Computers in Engineering WWW Site - Example 4.8

Example 4.8


FORTRAN Version

!
     PROGRAM P48
!
!
     IMPLICIT NONE
     INTEGER :: TRY,DIV
!
     PRINT *,2
L1:  DO TRY= 3,31,2
L2:     DO DIV= 3,TRY,2
          IF( MOD(TRY,DIV) == 0) THEN
            EXIT
          END IF
        END DO L2
     IF( MOD(TRY,DIV) /= 0 ) PRINT *,TRY
     END DO L1
     STOP
     END PROGRAM P48
     
OUTPUT:

              +--------------------------------------------------+
              |     32-bit Power for Lahey Computer Systems      |
              |   Phar Lap's 386|DOS-Extender(tm) Version 7.0    |
              |  Copyright (C) 1986-94 Phar Lap Software, Inc.   |
              |           Available Memory = 14880 Kb            |
              +--------------------------------------------------+


           2

Last modified: 08/07/97