// Fig. 2.20: fig02_20.cpp // Summation with for. #include using std::cout; using std::endl; // function main begins program execution int main() { int sum = 0; // initialize sum // sum even integers from 2 through 100 for ( int number = 2; number <= 100; number += 2 ) sum += number; // add number to sum cout << "Sum is " << sum << endl; // output sum // Example with multiple variables for ( int i = 0, j = 0; j+1 <= 10; j++, i++ ) cout << "i: "<