P62.F90

SWAP subroutine


!
! =====> Program - P62.F90
!
!
      PRINT *, 'This is Program >> P62  - Subroutine SWAP'
!
!
!     Tell program where data for  READ *  is coming from
      OPEN(UNIT=5, FILE='P62.DAT')      ! UNIT=5 is the default input
!
      READ *,I,J
      PRINT *,I,J
      CALL SWAP(I,J)
      PRINT *,I,J
      STOP
      END
!
      SUBROUTINE SWAP(I,J)
!     This routine will interchange any 2 INTEGER numbers
      K=I
      I=J
      J=K
      RETURN
      END

DATA:
47 39

OUTPUT:
Program entered
 This is Program >> P62  - Subroutine SWAP
 47 39
 39 47
Fortran-90 STOP

Come back to the previous page

Page builder: Charles Boivin

Last modified: 11/07/95