C234567890
      program prog01
      write(*,*) 'n, x = ?'
      read(*,*) n, x
      write(*,*) 'n, x = ',n,x
c
      sum = 0.0
      do k = 0,n
         sum = sum + x**k
      end do
c
      write(*,*) 'sum   = ',sum
c
      if(x.eq.1.0) then            ! IF ($B>r7o<0(B) THEN
         write(*,*) 'Exact = ',n+1
      else                         ! ELSE
         write(*,*) 'Exact = ',(1.0-x**(n+1))/(1.0-x)
      endif                        ! ENDIF
c
      stop
      end
