Home Reverse colors Help
Single page Previous Contents Next

Development with GNU/Linux
24 / 30

Fortran Examples

      PROGRAM F77DEMO
      DIMENSION X(100), Y(100)
      PI=2.*ACOS(0.)
      N=100
      DO 10 I=1,N
      X(I)=I*(2*PI/N)
 10   CONTINUE
      CALL TRIG(N,X,Y)
      DO 20 J=1,5
      PRINT 15, X(J), Y(J)
 15   FORMAT(2X,2F8.3)
 20   CONTINUE
      STOP
      END
C
      SUBROUTINE TRIG(N,X,Y)
      DIMENSION X(1), Y(1)
      DO 10 I=1,N
      Y(I) = SIN(X(I))*EXP(-X(I))
 10   CONTINUE
      RETURN
      END

Previous Contents Next
Contact