Question 14 / 15:  How many times is function fib called when num is 3, including the initial fib(3)?
int fib(int num) // Fibonacci value of a number

{

switch(num)

{

case 0:

return(0);

break;

case 1:

return(1);

break;

default:

return(fib(num - 1) + fib(num - 2));

break;

}

}

A  1
B  4
C  3
D  5
E  none
<< First < Previous Next > Last >>
Quiz Home Page
https://www.jobilize.com/foundations-of-software-engineering-by-prof-kevin-amaratunga-mit

Foundations of Software Engineering

Author:

Access: Public Instant Grading

Attribution:  Amaratunga, Kevin. 1.124J Foundations of Software Engineering, Fall 2000. (MIT OpenCourseWare: Massachusetts Institute of Technology), http://ocw.mit.edu/courses/civil-and-environmental-engineering/1-124j-foundations-of-software-engineering-fall-2000 (Accessed 2 May, 2014). License: Creative Commons BY-NC-SA
Ask
Marion Cabalfin
Start Quiz
Copy and paste the following HTML code into your website or blog.
<iframe src="https://www.jobilize.com/embed/foundations-of-software-engineering-by-prof-kevin-amaratunga-mit" width="600" height="600" frameborder="0" marginwidth="0" marginheight="0" scrolling="yes" style="border:1px solid #CCC; border-width:1px 1px 0; margin-bottom:5px" allowfullscreen webkitallowfullscreen mozallowfullscreen> </iframe>