Skip to content
Related Articles
Open in App
Not now

Related Articles

ISRO | ISRO CS 2017 | Question 73

Improve Article
Save Article
  • Last Updated : 15 Mar, 2018
Improve Article
Save Article

Consider the function

int fun(x: integer)
{
If x > 100 then fun = x – 10;
else
fun = fun(fun(x + 11));
}

For the input x = 95, the function will return
(A) 89
(B) 90
(C) 91
(D) 92


Answer: (C)

Explanation: f(95)–>f(f(106)) = f(96)–>f(f(107)) = f(97)–>f(f(108)) = f(98)–>f(f(109)) = f(99)–>f(f(110)) = f(100)–>f(f(111)) = f(101) = 91
So the correct option is (C)

Quiz of this Question

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!