Write Function Sort3d Sorts Three Integers Decreasing Order May Use Void Sort2d Int Int B Q37122554

Write a function sort3d() that sorts three integers indecreasing order. You may use:

void sort2d(int& a, int&b){ int temp; if (a < b) { temp = a; a = b; b = temp; }}


Solution


void sort3d(int& a, int& b, int& c){ //makes b > c sort2d(b,c); //makes a > b sort2d(a,b);

OR
OR

Leave a Comment

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