I am trying to write a program that uses a for loop to output the Fibonacci series to the number inputted. I have put the program I have so far, but am having trouble with getting the sum of all the terms
Here are some examples of what the output should look like:
Enter the number of terms in the Fibonacci series>2
F[2] = 0 + 1 = 1
Enter the number of terms in the Fibonacci series>4
F[4] = 0 + 1 + 1 + 2 = 4
Enter the number of terms in the Fibonacci series>8
F[8] = 0 + 1 + 1 + 2 + 3 + 5 + 8 + 13 = 33
I would rather not use the fib function...is there a way to solve my problem within the loop I already have or by using another loop in the if statement at the very end of my program?