From fe61f455b4aabc1dfb30c6303aa8b04449330958 Mon Sep 17 00:00:00 2001 From: Connor McDowell Date: Sat, 24 Feb 2024 14:53:54 -0800 Subject: screenshots taken to be added to lab, fibonacci array created --- Project1/helper.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Project1/helper.cpp') 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& 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 -- cgit v1.2.3