// This program illustrates a flag controlled while loop. // Write a program that sums integers and stops and prints the sum when the sum exceeds 20. #include using namespace std; int main() { int value, sum = 0; bool done = false; // initialize while (!done) // test { if (sum > 20) { done = true; // modify cout << " thanks " << endl; } else { cout << endl << "Enter an integer: " ; cin >> value; sum += value; } } cout<< "The sum is " << sum << endl; return 0; }