I'm trying to sort an array of ints, even numbers first and then odd numbers.
Say I have Array[10]={2,4,3,11,0,12,88,99,111,-15}
.
I want it to end up like this: 0, 2, 4, 12, 88, -15, 3, 11, 99, 111
for(i = 0 ; i < 10 ; i++) {
for(j = 0 ; j < 10 ; j++) {
if(Array[i] % 2 != 0) {
Array[j] = Array[i];
}
}
}
I'm lost. I have no idea how to proceed beyond that.