Skip to content

Commit

Permalink
fib
Browse files Browse the repository at this point in the history
  • Loading branch information
edg-l committed Sep 5, 2024
1 parent d3ee954 commit 2c57b73
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions tests/fib.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
int fib(int n);

int main() {
return fib(10);
}
int main() { return fib(10); }

int fib(int n) {
if (n == 0 || n == 1)
return n;
else
return (fib(n-1) + fib(n-2));
if (n == 0 || n == 1)
return n;
else
return (fib(n - 1) + fib(n - 2));
}

0 comments on commit 2c57b73

Please sign in to comment.