       FUNCTION AVERAGE ( IANARRAY,NSIZE)

       DIMENSION IANARRAY(NSIZE)
       SUM = 0
       DO 7 I = 1, NSIZE
         SUM = SUM + IANARRAY(I)
    7  CONTINUE
       AVERAGE = SUM/NSIZE
       RETURN
       END

       DIMENSION NUMBER(10)

C       THE FOLLOWING LOOP WILL OBTAIN 10 INTEGER VALUES FROM THE USER
C       HOWEVER YOU NEED A LINE OF INPUT DATA FOR EACH OF THE 10 READS
       DO 20 I = 1, 10
           READ (5, 30) NUMBER(I)
   20   CONTINUE
   30   FORMAT (10I2)
        DO 40 I = 1, 10
           WRITE (6, 50) NUMBER(I)
   40   CONTINUE
   50   FORMAT (1X, I2)

C      ALL 10 INPUT VALUES CAN BE ON 1 LINE BUT YOU NEED 10 VARIABLES
C      IN YOUR READ STATEMENT
       READ (5,30 ) NUMBER(1), NUMBER(2), NUMBER(3), NUMBER(4),
     6    NUMBER(5), NUMBER(6), NUMBER(7), NUMBER(8), NUMBER(9),
     6    NUMBER(10)

       DO 60 I = 1, 10
          WRITE (6,50) NUMBER(I)
          ANSWER = AVERAGE (NUMBER, 10)
   60  CONTINUE
       WRITE (6,17) ANSWER
   17  FORMAT (1X, ' THE AVERAGE OF THE ELEMENTS IS ', F6.2  )
       READ (5, 70) (NUMBER(I), I = 1,10)
   70  FORMAT (10I2)
   
       DO 80 I = 1, 10
          WRITE (6,50) NUMBER(I)
   80  CONTINUE



C       READ (5, 10) X
C C10    FORMAT (F5.3)
C      WRITE (6, 11) X
C  11    FORMAT (1X, F6.2)
        STOP
        END
