C Program to show 20 ways Fortran 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 2008, but its fixed source form, alternate
C return, and declaration beginning character* are all obsolescent. 
C Unlimited format as used in this program is new in F2008. List-directed
C internal read, use of lower case and contains, and comments beginning with
C ! are its only other features that were not valid Fortran 77.
      character c2
      integer j,k,n(2)
      data j,k/2*0/                ! repeated value in data            (3)
      call input(n,'2*4',c2,*666)  ! repeated value in list-directed 
C                                    input, ! alternate return         (4,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 character string   (10)
      print '(*(i4))', n           ! unlimited format item             (11)

      contains

      subroutine input(n,c1,c2,*) ! dummy alternate return argument   (12)
      integer   i,     n(*)        ! assumed-size array                (13)
      character ch,      c1*(*)    ! length selector ! assumed length
C                                       following variable name        (14,15)
      character*(*)         c2     ! length selector ! assumed length
C                                       following character keyword    (16,17)
      read(c1,*,iostat=i) n(1),n(2)! list-directed internal read        (18)
      if (i.ne.0) return 1
      print '(a)', 'Hit any key to continue.'
      read(*,'(a)',iostat=i)ch     ! default input unit                 (19)
      write(c2,'(i1)',iostat=i)666 ! writes '*': 666 is too big for I1  (20) 
      if(i.ne.0) return
      end subroutine input
      end program

