Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void order_vec( int a[], int n ){
- int i, j;
- for(i = 0; i < n; i++){ // Make a pass through the array for each element
- for(j = 1; j < (n-i); j++){ // Go through the array beginning to end
- if(a[j-1] > a[j]) // If the the first number is greater, swap it
- SWAP(a[j-1],a[j]);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement