# Program to input a, r, n and to evaluate sum of the G.P series:
print("a= First term, r= Common ratio, n= No. of terms")
a,r,n=input("Enter the value of a, r, n:").split(",")
n=int(n)
a=float(a)
r=float(r)
s=0.0
for m in range (0,n):
s=s+a*(r**m)
print("The sum of the G.P. series is= ",s)
print("a= First term, r= Common ratio, n= No. of terms")
a,r,n=input("Enter the value of a, r, n:").split(",")
n=int(n)
a=float(a)
r=float(r)
s=0.0
for m in range (0,n):
s=s+a*(r**m)
print("The sum of the G.P. series is= ",s)
Comments
Post a Comment