diff options
Diffstat (limited to 'c_compiler/test/in/fib.c')
-rw-r--r-- | c_compiler/test/in/fib.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/c_compiler/test/in/fib.c b/c_compiler/test/in/fib.c new file mode 100644 index 0000000..17a3b41 --- /dev/null +++ b/c_compiler/test/in/fib.c @@ -0,0 +1,20 @@ +int main() +{ + int n, first = 0, second = 1, next, c; + + n = 10; + + for ( c = 0 ; c < n ; c++ ) + { + if ( c <= 1 ) + next = c; + else + { + next = first + second; + first = second; + second = next; + } + } + + return next; +} |