I'm just trying to get a simple sorting by swapping algorithm to work on an existing unsorted array..
It's supposed to sort with the largest element being the first element and the lowest being the last. As the title says, what's wrong with it?Code:int a, b; for (a = 0;a<count;a++) { for (b=0;b< count;b++) { if (FREQUENCY[count] > FREQUENCY[count-1]) { int temp; temp = FREQUENCY[count]; FREQUENCY[count] = FREQUENCY[count-1]; FREQUENCY[count - 1] = temp; } } }