It's saying on line 13: name lookup of 'i' changed for ISO 'for' scoping
#include <iostream> using namespace std; int main() { int Fib[40]; Fib[0] = 1; Fib[1] = 1; cout << Fib[0] << Fib[1] << endl; for (int i=2; i<40; i++) Fib[i]=Fib[i-1]+Fib[i-2]; cout << Fib[i] << endl; }
cout << Fib[i] << endl;line is outside the for loop. Also fix your indentation.