C
C  fortran example 21
C
C  some more advanced formatting and manipulation of character type
C
C  CWJ SDSU 2/16/2005  
C  

      program program21
      implicit none

      integer age
      character*20 firstname
      integer ilast

      print*,' What is your age? '
      read*,age
      print*,' What is your name?' 
      read*,firstname

      print*,' Your age is ',age
      write(6,101)age

  101 format(1x,'Your age is ',i2)

      ilast=index(firstname,' ')   ! this finds end of name
      write(6,102)firstname(1:ilast-1)
  102 format(1x,'Your name is ',a10)


      end

