c_______________________________________________________________________________

c     Calculo del numero e (suma de n terminos de la serie).    Version DO WHILE

      implicit real*8 (a-h,o-z)

      parameter(UNO=1.d+00)

    1 write(6,'(/,a,$)') ' Numero de terminos = '
      read(5,*) n
      if (n.lt.0) goto 1

      f=UNO
      e=UNO
      i=1
      do while (i.le.n)
        f=f/dble(i)
        e=e+f
        i=i+1
      enddo

      write(6,100) n,e
  100 format(/,' n = ',i10,'      -> e = ',d24.16)

      read(5,'()')
      call exit(0)

      end
