What is the value of h(231,8) for the function below?
def h(m,n):
ans = 0
while (m >= n):
(ans,m) = (ans+1,m-n)
return(ans)
1
Expert's answer
2018-08-15T04:13:45-0400
Answer is 28.
(Explanation: function returns iteration number of while-cycle, in which value of <m> variable become smaller than <n>. This means that it need to 28 times consecutively subtract 8 from 231 to get a result less than 8)
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment