08-stack_overflow.c 253 Bytes
Newer Older
Xavier Besseron's avatar
PS 2021  
Xavier Besseron committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <stdio.h>
#include <stdlib.h>


int fibo(int n)
{
  if (n == 1)
    return 1;
  else
    return fibo(n-1) + fibo(n-2);
}


int main(int argc, char** argv)
{
  int n = 10;
  int res = fibo(n);
  printf("fibo(%d) = %d\n", n, res);

  return 0;
}