You are on page 1of 1

FORTRAN Program:

C Sum of Exponential Series with tolerance value C write(*,*)'Give x and tolerance value' read(*,*)x,tol n=1 sum=1.0 term=x expx=exp(x) do i=1,100 if(abs(term).lt.tol)go to 10 sum=sum+term n=n+1 term=term*x/n enddo 10 write(*,*)x, calculated value, correct value write(*,*)x,sum,expx stop end

INPUT AND OUTPUT

INPUT

OUTPUT

You might also like