// File: ForLoopNoErrorSentinel.cpp // Sentinel Terminated; ; Initialize Using First Value; For Loop // Find the Extremes in a List of integers // Use a boolean flag to facilitate all data input into the program loop // Method of Iteration: for loop #include #define False 0 #define True 1 #define Sentinel -999 using namespace std; int main() {int Value,Min,Max; // Prompt For First Value cout << "Enter the 1st Integer. " << Sentinel << " Quits >"; // Read first Value Before Loop cin >> Value; // Must Check For Sentinel Here if (Value!=Sentinel) { Max=Min=Value; cout << "Enter the Next Integer. " << Sentinel << " Quits >"; for (cin >> Value;Value != Sentinel; cin >> Value) { if (Value>Max) Max=Value; else if (Value"; } cout << "Minimum:" << Min << "\tMaximum:" << Max << endl; } return(0); }