So honestly I thought I was right on this one, but apparently I'm not. I have to make a Do while loop that will output the sum of the square of the even numbers between and including the firstVar and the secondVar. I cound eaily do this in a while loop but he wants in a do while...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
//Part D
sumOfVar = 0;
do {
if (firstVar % 2 == 0)
{
counter = firstVar;
}
else
{
counter = firstVar +1;
}
} while (counter <= secondVar);
{
sumOfVar = sumOfVar + (counter * counter);
counter = counter + 2;
}
cout << endl << "Part D: " << endl << "The sum of the even square integers between and including " << firstVar << " and " << secondVar << " are: " << sumOfVar << endl;