Recursion, Recursion

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
int y(int x) {

  if (x==0 || x==1) {

    return 1;

  } else {

    return y(x-1) + y(x-2);
  }

}

If this program returned 8, what does x equal to?

×

Problem Loading...

Note Loading...

Set Loading...