Hey, so a few posts ago I showed some code regarding ordering numbers into ascending order. I discovered the bubble-sort algorithm and after being sent this code by a user on this forum, decided to see if it worked. However it doesn't output anything.
I have absolutely no idea why as the for loop at the bottom should output all the numbers ... but for some reason it doesn't (or at least 1 number).
This should work .. the first loop checks the value of the first number against the value of the second and then the third etc.
The outer for loop counter then makes it reset the j counter inside and so starts all over again. There are 100 checks on the various numbers in the array 's'.
Then at the end the for loop will simply print out the array 's' based on the value of 'i' at each of the loop counts. I fail to see what is actually going wrong here.
This is the console window:
As you can see, the array seems to get stored and potentially sorted.. but then the program just ends.
Any help would be great