+ 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

9th Mar 2018, 11:08 AM
МаĐșŃĐžĐŒ
МаĐșŃĐžĐŒ - avatar
2 Answers
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
11th Mar 2018, 1:03 AM
TurtleShell
TurtleShell - avatar
0
this code must sort the array, even numbers must go to the beginning, then odd numbers.
11th Mar 2018, 4:17 AM
МаĐșŃĐžĐŒ
МаĐșŃĐžĐŒ - avatar