From 2c8589f9b6a9d18ab5601da4ae052e9a1119d9fa Mon Sep 17 00:00:00 2001 From: SuhaniSharma1309 Date: Tue, 18 Mar 2025 22:09:31 +0530 Subject: [PATCH 1/2] Modified the cpp file --- fixme.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fixme.cpp b/fixme.cpp index 547f2d9..5d2a160 100644 --- a/fixme.cpp +++ b/fixme.cpp @@ -1,4 +1,4 @@ -#include + #include using namespace std; // Function to generate Fibonacci series up to n terms @@ -8,10 +8,10 @@ cout << "Fibonacci Series: "; for (int i = 0; i < n; i++) { // FIXME: Print the first term correctly - cout << "?" << " "; + cout << first << " "; // FIXME: Compute the next term correctly - next = ?; + next = first + second; first = second; second = next; } @@ -24,7 +24,7 @@ cin >> n; // FIXME: Call the function with correct argument - fibonacci(?); + fibonacci(n); return 0; } \ No newline at end of file From e37cbbcf756f05e63b4e71728edfe0c58a1cefcd Mon Sep 17 00:00:00 2001 From: SuhaniSharma1309 Date: Tue, 18 Mar 2025 22:20:46 +0530 Subject: [PATCH 2/2] Modified spacing, comments --- fixme.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fixme.cpp b/fixme.cpp index 5d2a160..7accba5 100644 --- a/fixme.cpp +++ b/fixme.cpp @@ -1,5 +1,5 @@ #include - using namespace std; + using namespace std; // Function to generate Fibonacci series up to n terms void fibonacci(int n) { @@ -7,10 +7,10 @@ cout << "Fibonacci Series: "; for (int i = 0; i < n; i++) { - // FIXME: Print the first term correctly + // FIXME: Print the first term correctly---FIXED cout << first << " "; - // FIXME: Compute the next term correctly + // FIXME: Compute the next term correctly--FIXED next = first + second; first = second; second = next; @@ -23,7 +23,7 @@ cout << "Enter the number of terms: "; cin >> n; - // FIXME: Call the function with correct argument + // FIXME: Call the function with correct argument--FIXED fibonacci(n); return 0;