asjfda
No notes
Syntax:
No syntax
void sortArray(int sortedArray[]) { //Create variables bool flag = 0; int temp, counter; //Start a loop to sort the array, continues until array is in order while (flag == 0) { //Counter that keeps track of number values in the correct order counter = 0; //Runs through every value in the array for (int i = 0; i < paleSize - 1; i++) { // if (sortedArray[i] > sortedArray[i + 1]) { temp = sortedArray[i]; sortedArray[i] = sortedArray[i + 1]; sortedArray[i + 1] = temp; } else counter++; } if (counter == (paleSize - 1)) break; else continue; } for (int i = 0; i < paleSize; i++) { cout << sortedArray[i] << endl; } }