1234567891011121314151617181920212223
int swapHolder = -1; int end = 10; int length = 10; int myArray[] = { 36, 12, 345, 732, 117, 532, 98, 54, 271, 344 }; for(int counter = length - 1; counter > 0; counter--) { for(int index = 0; index < end; index++) { if(myArray[index] > myArray[index+1]) { swapHolder = myArray[index+1]; myArray[index+1] = myArray[index]; myArray[index] = swapHolder; } } for(int index = 0; index < 10; index++) { cout << myArray[index] << ", "; } cout << endl; end--; }