diff --git a/fixme.c b/fixme.c index 1ee81c5..dc845bd 100644 --- a/fixme.c +++ b/fixme.c @@ -9,8 +9,8 @@ int fibonacci(int n) { temp = a + b; a = b; b = temp; - return b; //Fix me } + return b; } int main() { diff --git a/fixme.py b/fixme.py index bed76dd..3ef9948 100644 --- a/fixme.py +++ b/fixme.py @@ -1,13 +1,13 @@ def fibonacci_iterative(n): if n <= 0: return 0 - elif n == 2: #Fix me + elif n == 1: return 1 a, b = 0, 1 for _ in range(2, n+1): a, b = b, a + b - return b # Fix me. + return b n = 10 print(f"The {n}th Fibonacci number is: {fibonacci_iterative(n)}") \ No newline at end of file