summaryrefslogtreecommitdiff
path: root/tex/thesis/implementation/experiments/fib.c
blob: 597f005ec3eae7ffd6ff2914884e41bdd8874424 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
int fib() {
  int fib_last = 0;
  int fib = 1;
  int i = 0;
  while (i < 20) {
    int temp_fib = fib;
    fib = fib + fib_last;
    fib_last = temp_fib;
    i = i + 1;
  }
  return fib;
}