# Program to find the sum of the finite exponential series:
a=input("Enter the value of x:")
s=1.0
t=float(a)
n=1
a=float(a)
while abs(t)>=0.00001:
s=t+s
n=n+1
t=t*a/n
print("The value of exp(",a,") is:",s)
a=input("Enter the value of x:")
s=1.0
t=float(a)
n=1
a=float(a)
while abs(t)>=0.00001:
s=t+s
n=n+1
t=t*a/n
print("The value of exp(",a,") is:",s)
Comments
Post a Comment