      PROGRAM TABLE
************************************************************************
* Program demonstrating the use of formatted output to print a table   *
* of values of N, the square and cube of N, and the square root of N   *
* for N = 1, 2, ..., LAST where the value of LAST is read during       *
* execution.                                                           *
*                                                                      *
* Input:  LAST                                                         *
* Output: Table of values of N, N**2, N**3, and square root of N       *
************************************************************************


      INTEGER N, LAST

      WRITE (*, *) 'ENTER LAST NUMBER TO BE USED'
      READ *, LAST

*     Print headings

      WRITE (*, 100) 'NUMBER', 'SQUARE', '  CUBE', 'SQ. ROOT'
100   FORMAT(// 1X, A8, T11, A8, T21, A8, T31, A10 / 1X, 40('='))

*     Print the table

      DO 10 N = 1, LAST
          WRITE (*, 110) N, N**2, N**3, SQRT(REAL(N))
110       FORMAT(1X, I6, 2I10, 2X, F10.4)
10    CONTINUE

      END

