C Program to show 19 ways F95 uses the asterisk. Comments at ends of 
* lines mark uses of *, as here:   ! Comment line ! character in it.  (1,2) 
C This program is valid Fortran 95, but its fixed source form, alternate 
C return and CHARACTER*(*) declaration are all obsolescent. List-directed 
C internal read and comments beginning with exclamation marks are its only
! features that were not valid Fortran 77.

      CHARACTER C2
      INTEGER J,K,N(2)
      DATA J,K/2*0/                ! repeated value (RV) in DATA      (3)
      CALL INPUT(N,'2*4',C2,*666)  ! RV for list-directed input,      (4)
                                   ! alternate return                 (5)
      WRITE(*,'(2I2,1X,A)') N(1)*J,! default output unit, multiply    (6,7)
     *      N(2)**K,C2             ! continuation line,exponentiate   (8,9)
      STOP
 666  PRINT '(A)', ' * ERROR IN N' ! in non-comment char. string      (10)
      END
C
      SUBROUTINE INPUT(N,C1,C2,*)  ! dummy argument for alt. return   (11)
      INTEGER   I,     N(*)        ! assumed-size array               (12)
      CHARACTER CH,      C1*(*)    ! length selector ! assumed length 
C                                        following variable name      (13,14)
      CHARACTER*(*)         C2     ! length selector ! assumed length
C                                        following CHARACTER          (15,16)
      READ(C1,*,IOSTAT=I) N(1),N(2)! list-directed internal read      (17)
      IF (I.NE.0) RETURN 1
      PRINT '(A)', ' HIT ANY KEY TO CONTINUE'
      READ(*,'(A)',IOSTAT=I) CH   ! default input unit                (18)
      WRITE(C2,'(I1)',IOSTAT=I)666! writes * as 666 is too big for I1 (19)
      IF(I.NE.0) RETURN
      END 

