diff options
| author | Connor McDowell <[email protected]> | 2024-02-24 14:53:54 -0800 |
|---|---|---|
| committer | Connor McDowell <[email protected]> | 2024-02-24 14:53:54 -0800 |
| commit | fe61f455b4aabc1dfb30c6303aa8b04449330958 (patch) | |
| tree | 81ec474e09d2873a56969d22f41c4fa22e736e8f /Project1/helper.cpp | |
| parent | fixed errors, just looking around to help with another assignment (diff) | |
| download | lab-01-connormcdowell275-fe61f455b4aabc1dfb30c6303aa8b04449330958.tar.xz lab-01-connormcdowell275-fe61f455b4aabc1dfb30c6303aa8b04449330958.zip | |
screenshots taken to be added to lab, fibonacci array created
Diffstat (limited to 'Project1/helper.cpp')
| -rw-r--r-- | Project1/helper.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Project1/helper.cpp b/Project1/helper.cpp index de05926..a90fc36 100644 --- a/Project1/helper.cpp +++ b/Project1/helper.cpp @@ -43,4 +43,18 @@ void Print(const std::list<int>& myList) std::cout << i << std::endl; } +} + +void Fibonacci(int(&cArray)[SIZE]) +{ + cArray[0] = 0; + cArray[1] = 1; + for (int i = 2; i < SIZE; i++) + { + cArray[i] = cArray[i - 1] + cArray[i - 2]; + } + for (int i = 0; i < SIZE; i++) + { + cout << cArray[i] << " "; + } }
\ No newline at end of file |