I need help implementing quick sort on this but everything else works right. I don't get any errors when compiling the program but when I run it and enter the values I get an error that says it has stopped working. Thanks for any help in advance.

Code:#include <iostream> #include <iomanip> using namespace std; const int MAX_ACCOUNTS = 200; void readcustomeridacctbalance(int idarray[], int numaccounts, double balancearray[]); void quicksort(int idarr[], int low, int high); void displaydata(int idarray[], int numaccounts, double balancearray[], double minpayment[]); void main() { int number, idarray[MAX_ACCOUNTS]; double balancearray[MAX_ACCOUNTS], minreqpayment[MAX_ACCOUNTS]; cout << "Enter the number of accounts: "; cin >> number; while(number>MAX_ACCOUNTS) { cout << "That is an invalid number of accounts. Please reenter: "; cin >> number; } readcustomeridacctbalance(idarray, number, balancearray); int left = idarray[0], right = idarray[number]; quicksort(idarray, left, right); displaydata(idarray, number, balancearray, minreqpayment); } void readcustomeridacctbalance(int idarray[], int numaccounts, double balancearray[]) { for(int i = 0; i < numaccounts; i++) { cout << "What is your ID number? "; cin >> idarray[i]; cout << "What is your account balance? "; cin >> balancearray[i]; } } void quicksort(int idarr[], int low, int high) { int i = low, j = high, tmp, pivot = idarr[(low+high)/2]; while (i <= j) //While there is more than 1 account { while (idarr[i] < pivot) i++; while (idarr[j] > pivot) j--; if (i <= j) { tmp = idarr[i]; idarr[i] = idarr[j]; idarr[j] = tmp; i++; j--; } }; // recursion if (low < j) quicksort(idarr, low, j); if (i < high) quicksort(idarr, i, high); } void displaydata(int idarray[], int numaccounts, double balancearray[], double minpayment[]) { unsigned int totalid=0; double totalbalance=0, totalminpayment=0; cout << "_______________________________________________________________\n" <<setw(11)<<"ID"<<setw(20)<<"Account Balance\n"<<setw(31) <<"_______________________________________________________________\n"; for(int i = 0; i < numaccounts; i++) { cout <<setw(11)<<idarray[i] <<setw(10)<< "$" << balancearray[i]<<"\n"; totalid+=idarray[i]; totalbalance+=balancearray[i]; } cout << "_______________________________________________________________\n" << "Total: " << setw(1) << totalid << setw(10) << "$" << totalbalance << setw(27)<< "\n\nAverage Account Balance: $" << totalbalance/numaccounts << "\n"; }