// ----------------------------------- // BUBBLE-SORT. //------------------------------------ #include void swap(int &a, int &b) {int temp=a; a=b; b=temp;} bool compare(int x, int y) {return (x>y);} void printar(int A[], int size) {for (int i=0; i= 1 void main() {const int max = 6; int C [max]= {88,77,80,4,36,78}; cout << "\nGiven array is:\n "; printar(C,max); if (max > 1) {sort(C, max);} cout << "\n\nSorted array is:\n "; printar(C,max); cout << "\n\n";} //-------------------------------- // input: output: // // Given array is: // 88 77 80 4 36 78 // // Sorted array is: // 4 36 77 78 80 88 // //--------------------------------