Find the output of following program: int F(n) { if n == 0 return 0; if n == 1 return 1; return F(n-2)+F(n-1); } int main() { result F(5); }

Find the output of following program:

int F(n) {
if n == 0
return 0;
if n == 1
return 1;
 return F(n-2)+F(n-1);
}
int main() {
result F(5);
}

From the Sonali & Janata Bank Officer (IT) October 2023 – Written (MIST) exam, question 2 of 18.

More from this paper