Because the logic was wrong.
There was no need for a nested loop.
The program is simply swapping elements from index starting at 0 (in j) with those from index starting at 10 (in i)
Type: Posts; User: Norm
Because the logic was wrong.
There was no need for a nested loop.
The program is simply swapping elements from index starting at 0 (in j) with those from index starting at 10 (in i)
What does the value of 8 represent? Why was that value chosen as a loop start point?
I don't understand what those instructions say. Can you show an example on an array with numbers in order:...
Can you post the different results that show what you are talking about? Add some comments to the output describing the problem and show the desired output.