Can someone check my code to see if it works. I can't get it to output anything.. (it does compile)
I'm not sure that my swap is working properly.
Thanks!
wwwiii that is how to swap the varaibles. But he has a few other errors. 1) he has a return in a void function. 2) he is not modifying the values being passed into the function he is modifying the local copies of them. He should be passing by reference.
As per helios "There's at least one control path in your program where nothing is printed."
You are not printing the output when u are inputting numbers already in ascending order. you can write else part for if(var3 < var2) for that case.
Your code can be simplified as well. Here is a simplified version of your code if it helps
/**********************************************************/
int var1, var2, var3;