+ 2
Why is not working?
3 Respuestas
+ 2
The swap ensures that a >= b, so I'd say the condition in your loop is incorrect, and should be x >= b.
+ 4
for(x = a; x >= b; x--)
+ 1
what are you trying to achieve?
actually the loop is never executed, as if a<b you swap var (so now b<=a) and loop check if x (initialized with a) is <=b... to run...