You should put up your entire code because from what I can see and if everything you say is true then this program should be working and you should be receiving output.
#include <iostream>
int main()
{
int stop = 6;
int sum = 0;
for (int num = 4; num <= stop ; num++)
{
sum +=2 * num;
std::cout << sum << ' ';
}
return 0;
}