nth term of gp in python when 2,3 terms given code example
Example: nth term of gp in python when 2,3 terms given
n1=int(input())
n2=int(input())
n=int(input())
r=n2/n1
a=n1/r
print(a*r**(n-1))
n1=int(input())
n2=int(input())
n=int(input())
r=n2/n1
a=n1/r
print(a*r**(n-1))