1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
void fibonacci(int n)
{
  int tmp;
  int result;
  int i;
  int b;
  int a;

  a = 0;
  b = 1;
  i = 0;
  while (i <= n) {
    a = b;
    i = (i + 1);
    tmp = (a + b);
    b = tmp;
  };
  result = a;

}