How can you write a sorting algorithm for three intergers in simple english terms before it is translated into C?

Do the three integers come in an array or in three distinct variables?

Can you clarify if the sorting algorithm should work for 3 (and no more) or is it a general algorithm that you are supposed to do?

A general one is not much more complicated, but requires the use of for-loops.

For a general sorting using bubble sort (the simplest and the slowest):

N=number of items
A(i)=item i from array A

loop i from 1 to N-1
loop j from i+1 to N
if(A(i)>A(j)) exchange A(i) and A(j)
end loop j
end loop i

To write a sorting algorithm for three integers in simple English terms, you can follow these steps:

1. Start by comparing the first and second integers.
- If the first integer is greater than the second, swap their positions.
- If the first integer is smaller than or equal to the second, leave them as they are.

2. Next, compare the second and third integers.
- If the second integer is greater than the third, swap their positions.
- If the second integer is smaller than or equal to the third, leave them as they are.

3. Again, compare the first and second integers.
- If the first integer is greater than the second, swap their positions.
- If the first integer is smaller than or equal to the second, leave them as they are.

By following these steps, you are effectively sorting the three integers in ascending order. Once you have the algorithm defined in simple English terms, you can then translate it into a programming language like C.