syntax of recursionint fibint num fibonacci value


Syntax of recursion

int fib(int num)

/* Fibonacci value of a number */

{      switch(num) {

case 0: return(0); break;

case 1: return(1); break;

default:  /* Including recursive calls */

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

break;

}

}

 

 

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: syntax of recursionint fibint num fibonacci value
Reference No:- TGS0305404

Expected delivery within 24 Hours