I've been in different programming forums and in on of 'em, there's a riddle that says:
To write an algorithm that sorts an array of integers.
What do I mean?
For example,
I have this array:
Now, I gotta create a function that sorts the array from:Code:int num[8] = "{7, 5, 2, 1, 3, 4, 6, 0};
7, 5, 2, 1, 3, 4, 6, 0
to:
0, 1, 2, 3, 4, 5, 6, 7
I tried many many ways but non of my tries worked.
How do I do it?
Thanks.