test(int *a, int *b) $\implies$ In this function, we’re recursively subtracting *b from *a until (*a – *b) becomes less than 0.
ie int c = *a – *b – *b – *b – … – *b < 0 $\equiv$ *a – n * *b < 0 $\equiv$ *a < n * *b (n = smallest integer that satisfies this condition)
test( … ) returns ( 1 + next_call_of test( … ) ) or 0 ie test( … ) returns 1 + 1 + 1 + … + 1 ( n – 1 times) + 0 = n – 1.
test(&x, &y) will return (n – 1) such that n is smallest integer that satisfies x < n * y.
Examples,
- Consider, x = 5, y = 4, then test(&x,&y) will return 1, since x < 2 * y.
- Consider, x = 99, y = 4, then test(&x,&y) will return 24, since x < 25 * y.
- Consider, x = 100, y = 4, then test(&x,&y) will return 25, since x < 26 * y.
In given question, x = 15, y = 4, then test(&x,&y) will return 3, since x < 4 * y.
Answer :- B.