Computer Science, asked by TbiaSamishta, 1 year ago

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)

Answers

Answered by aqibkincsem
0

"The answer to this question is 28.

The white loop will run 28 times.

In the first step, since 231≥8.

(u, 231)=(1,223)

Then in the second step,

(1,223)=(2,215)

This will run for 28 times when m will  finally reach 7 or less than 8. the value of n at that point value of 7 is 28."

Similar questions