Computer Science, asked by tharunreddyboyapally, 10 months ago

What is the value of f(4000) for the function below?
def f(x):
d=0
while x >= 1:
(x,d) = (x/5,d+1)
return(d)​

Answers

Answered by ansh1709goyal
0

6

Please mark this answer as the brainliest answer

Answered by AskewTronics
0

It will prints 6 for the value of f(4000)

Explanation:

  • The above code is written in python language which has one function "f" which will return the value 6 for the value of x=4000.
  • It is because the above code displays the count the number of occurrences after dividing the number by 5 and the quotient is greater than 1.
  • When a user passes 4, then it will prints 1 because 4 is divided one time by 5 and the quotient is not greater than 1 after divisible.
  • When a user passes 4000 for the value of "x", then the quotient became after divisible by 5 are "800.0, 160.0, 32.0, 6.4, 1.28, 0.256" but the last number is less than 1. SO the above code will display 6.

Learn More:

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