It is printing the sequence fine but when it comes to the sum it's off. Any sort of help would be great. Not expecting anyone to give me answers or do it for me, just a little help />

If you require any more details/info let me know.

n is the users input

#include <iostream> using namespace std; int fib(int n) { if (n == 0) return 0; if (n == 1) return 1; return (fib(n-1)+fib(n-2)); } int fib2(int n) { int a = 0, b = 1, c = 0; for (int i = 0; i < n; i++) { cout << a << " "; c = a + b; a = b; b = c; } return b; }