diff options
Diffstat (limited to 'tex/thesis/implementation/experiments/fib.c')
-rw-r--r-- | tex/thesis/implementation/experiments/fib.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tex/thesis/implementation/experiments/fib.c b/tex/thesis/implementation/experiments/fib.c new file mode 100644 index 0000000..597f005 --- /dev/null +++ b/tex/thesis/implementation/experiments/fib.c @@ -0,0 +1,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; +} + |