Wrote C Programming Sorting Algorithm Larger Context Problem Trying Solve Cannot Figure S Q37130358

I wrote this C programming sorting algorithm in the largercontext of a problem I am trying to solve, and I cannot figure outwhy it’s not working. It is supposed to take a user input of thenumber of carriages on a train (of up to 50), the order ofcarriages on a train (carriage 1, carriage 2, carriage 3 etc.), andthen reprint them in the order of least to greatest. For example,if I wanted a train with 5 carriages, and entered the order as 5 43 1 2, it should look like this.

5

5 4 3 1 2

1 2 3 4 5

However, when

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.