Ou are given two numbers a and b. You need to find the power of a that is closest to b
Answers
Answered by
0
Answer:
Step-by-step explanation:def nearestPower(a,b):
n=1
for i in range(1, b) :
if(pow(a,i)<=b):
n=pow(a,i)
else:
break
return(n)
Similar questions