//*********************************************************************** // // sort2.cpp // Sorts two numbers entered by the user. // // Algorithm: // 1.) print 'Enter two numbers: ' // 2.) get a, b // 3.) if a>b // 4.) temp <- a // 5.) a <- b // 6.) b <- temp // 7.) print a ' ' b // 8.) stop // //*********************************************************************** #include using namespace std; int main(){ double a, b, temp; cout << "Enter two numbers: "; cin >> a >> b; if( a>b ){ temp = a; a = b; b = temp; } cout << a << " " << b << endl; return 0 ; }