C This program illustrates the use of a function with multiple parameters
       WRITE (6, 13)" Please enter three 5 digit integers all on 1 line"
       READ (5,10) A, A1, A2
       WRITE (6,15) A, A1, A2
       DO 30, J = 1, 5
          T = J
          ANSWER = FUN (T, A, A1, A2)
          WRITE (6,20) J, ANSWER
   30  CONTINUE
   13  FORMAT (1X, A50)
   10  FORMAT (3F5.1)
   15  FORMAT (1X, 3F8.2)
   20  FORMAT (1X, 'Fun(', I2, ')=', E10.2)
       STOP
       END

       FUNCTION FUN (S, R, R1, R2)
       WRITE (6, 10) S, R, R1, R2
   10  FORMAT (1X,  'Arguments passed to the function are ' /1x, 4F10.2)
       FUN = R + R1**S + R2*S**3
       RETURN
       END
