+ 1
Why my code works as wasn't planed?
This code should sort massive, but sometimes it return random big numbers https://code.sololearn.com/c6EWPF6Zh3or/?ref=app
2 Respostas
0
Hello! I don’t understand what your code code is supposed to do but I can guess why you are getting random numbers. Normally when you get random big numbers is when you use a variable that wasn’t assigned a value. Like this...
int var;
cout << var; // will print out a random integer
Also I would recommend to make the variable names more descriptive than just x, a, b at the start of main
0
this code must sort the array, even numbers must go to the beginning, then odd numbers.