This code supports all conditions of integers but ,why is this code not supporting decimal numbers? Please tell me....
#To print the series of GP
n=int(input("no. of terms to be printed :"))
a1=float(input(""))
a2=float(input(""))
c=0
if(n<=0):
print("enter the positive no. ")
elif(n==1):
print("G.P.:",a1)
print("G. P. ")
while(c<n):
print(a1)
r=a2/a1
b=a1r
a1=a2
a2=br
c+=1
STADIN
6
0.15
0.015
OUTPUT:
no. of terms to be printed :G. P.
0.15
0.015
0.0015
0.00015000000000000001
1.5000000000000002e-05
1.5000000000000002e-06
No answers yet!
4 years ago by Secret