for (i=2;i<21;i++)
{
fib[i]=fib[i-1]+fib[i-2]; <---regular fibonacci sequence..
if (i==2*i-1) <--if it is every other number then pring out the fib sequence
{
std::cout << " " << fib[i-1]+fib[i-2]<<endl;
}
else
{
std::cout << " " <<endl;
}
}
neither do i... and where did you get this "if (i==2*i-1)" ????
in my example, i put this only to separate the numbers with a comma and a "{}" on the begin and end of the sequence
it says if 'i' is equal the size of the vector less one, will be putted a space before show the last nuber of the requested sequence..