!Anthony Mahieu !Jon Shier !Engineering 160H !October 17th, 2001 program e real::factval,x,sum integer::i,n write(*,*)"What is the maximum n: " read(*,*)n write(*,*)"What is x: " read(*,*)x do i=0,n factval=find_fact(i) sum = sum + (x**i/factval) end do write(*,*)"The sum is: ",sum stop CONTAINS !!!!FACTORIAL!!!! FUNCTION find_fact(n) real::find_fact,total integer::i integer::n total=1 if(n==0)then find_fact = 1 else if(n==1)then find_fact = 1 else do i=2,n total=total*i end do find_fact=total end if RETURN END FUNCTION find_fact RETURN end program e