I'm trying to ru this code however it's not working for me. I need to switch the value of "x" with the value of "y" if (x<y) however it's not working the way I wrote it. Does anyone have any suggestions?
Code:{ int x=0; int y=0; int temp=0; int remainder=0; // read in the two integers cout << endl ; cout << "Enter the first number (integer) : " ; cin >> x ; cout << "Enter the second number (integer) : " ; cin >> y ; //echo inputs cout << "Input numbers are: " << x << " , " << y << endl; if ( x < y) { // exchange values of x and y temp=x; x = y; y==temp; }



LinkBack URL
About LinkBacks



