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
- Previous: Analize the following code: SELECT department_name, AVG(salary) as average_salary FROM employees JOIN department d ON e.department_id =…
- Next: Write a program for following sequence and analyze complexity of the program 1, 2, 2, 3, 3, 3, ............... 100 (100 times)
- All questions in Sonali & Janata Bank Officer (IT) October 2023 – Written (MIST)