Computer Science, asked by poojareddy2747, 10 months ago

What does h(3231) return for the following function definition?

def h(x):
(m,a) = (1,0)
while m <= x:
(m,a) = (m*2,a+1)
return(a)​

Answers

Answered by viswacps
2

Answer:

t

Explanation:

it is the answer so it is the answer as it is the answer that's why it's the answer finally it's only the answer

Answered by AskewTronics
0

The above defined function returns the value 12 for the x value of 3231.

Explanation:

  • The above-defined code is in python language, in which it returns the value of (n-1) if the value of 2^{n} is greater than the value of x (which is the input of the program).
  • So when the user enters 3231, then it will get 12 because 2^{13} is greater than the 3231 value.
  • So 13-1 gives 12, which is also defined in the first statement.

Learn More:

  • Python : https://brainly.in/question/14689905
Similar questions