The function terminates when a==b
; so to show that it doesn't terminate, you could show that a & b never get closer together with successive calls -- which in this case, is pretty easy.
(The above does not take into account overflow. Also, (d) can't be correct, since it doesn't loop at all.)
manpreet
Best Answer
2 years ago
I have this exam question:
Look at this example of pseudocode:
The answers given are:
Personally I think it's d), but I just wanted to make sure.