Open In App
Related Articles

ISRO | ISRO CS 2008 | Question 66

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Report issue
Report
What is the value of F(4) using the following procedure:
function F(K : integer)
integer;
begin
if (k<3) then F:=k 
else F:=F(k-1)*F(k-2)+F(k-3)
end;
(A) 5
(B) 6
(C) 7
(D) 8


Answer: (A)

Explanation: F(4) = F(3)*F(2)+F(1) = 5 F(3) = F(2)*F(1)+F(0) = 2 F(2) = 2 F(1) = 1 F(0) = 0 Correct option is (A)

Quiz of this Question

Last Updated : 13 Jun, 2018
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads