// sort2.cpp // interactive driver loop #include using namespace std; const char SPACE = ' '; int main(){ int tests; //user input-- no. of tests to run int n1, n2, //two ints entered by user tmp; //used for exchange //prompt and read tests cout << "enter no. of tests: "; cin >> tests; //interactive driver loop for (int i = 1; i <= tests; i++){ cout << "Test " << i << ". Enter two ints: "; cin >> n1 >> n2; //echo inputs cout << n1 << SPACE << n2 << SPACE; //n1, n2 in sorted order? if(n1 > n2){ tmp = n1; n1 = n2; n2 = tmp; } //display results cout << "Min = " << n1 << SPACE << "Max = " << n2 << endl; } //end for return 0; }