asked 187k views
2 votes
Consider the following pseudocode function. function Crunch(x is in R) if x ≥ 100 then return x/100 else return x + Crunch(10 · x) (a) Compute Crunch(5). Crunch(5) =

1 Answer

3 votes
Hello,

Let call f(x)= Crunch(x)
f(5)=5+f(10*5)=5+f(50)\\\\ f(50)=50+f(10*50)=50+f(500)=50+5=55\\\\ f(5)=5+f(50)=5+55\\\\ \boxed{f(5)=60}

answered
User Mohammed Saleem
by
8.2k points