Hey Guys, I'm back again and in need of your help again.

Here is my code and the problem is that my program crashes and I don't know why. Can anyone help me debug it?

Thanks in Advance GuysCode:#include<iostream> #include<cstdlib> #include<iomanip> using namespace std; int main(){ int array[15],cnt=0,hold,inloop,sort,mode,modetemp,modecnt; int cnt2=0,modecount[15][2],primecount=0,primedivisor,row=0,col=0; float mean,sum=0; cout<<"Enter Array of 15 Integers: "<<endl<<endl; //INPUT AND SUM for(inloop=1;inloop<=15;inloop++) { cout<<"Value of Array ["<<inloop<<"] - "; cin>>array[cnt]; sum=array[cnt]+sum; cnt++; } //LOOP TO SORT ARRAY(ASCENDING) for(cnt=1;cnt<=15;cnt++) { for(sort=0;sort<15-1;sort++) { if(array[sort]>array[sort+1]) { hold=array[sort]; array[sort]=array[sort+1]; array[sort+1]=hold; } } } //FINDING THE MEAN AND DISPLAY mean=sum/cnt; cout<<"Mean\t\t\t\t"<<fixed<<showpoint<<setprecision(1)<<mean<<endl; //INITIALIZING THE VALUE OF 2DARRAY MODECOUNT for(row=0;row<15-1;row++) { if(row=13) { row++; for(col=0;col<2;col++) modecount[row][col]=0; row--; } for(col=0;col<2;col++) { modecount[row][col]=0; } } //modecount[0][0]=1; //LOOP TO FIND MODE for(cnt=0;cnt<15;cnt++) { for(cnt2=0;cnt2<15;cnt2++) { if(array[cnt]==array[cnt2]) { ++modecount[cnt][0]; modecount[cnt][1]=array[cnt2]; // modecount[cnt][0]++; } else if(array[cnt]!=array[cnt2]) modecount[cnt][0]=0; } } modetemp=1; cout<<"modecount = "<<modetemp<<endl; for(cnt=0;cnt<15;cnt++) { if(modecount[cnt][0]>modetemp) { modetemp=modecount[cnt][0]; modecnt=cnt; } } cout<<"modecnt = "<<modecnt<<endl; cout<<"modecount[14][1] = "<<modecount[14][1]<<endl; mode=modecount[modecnt][1]; cout<<"Median\t\t\t\t"<<array[7]<<endl; cout<<"Mode\t\t\t\t"<<mode<<endl; cout<<"Min\t\t\t\t"<<array[0]<<endl; cout<<"Max\t\t\t\t"<<array[14]<<endl; //FIND THE EVEN NUMBERS cout<<"Even Numbers\t\t\t"; for(cnt=0;cnt<15;cnt++) { if(array[cnt]%2==0) { if(array[cnt]==array[cnt+1]) { cnt++; if(array[cnt]==array[cnt+1]) { cnt++; if(array[cnt]==array[cnt+1]) { cnt++; if(array[cnt]==array[cnt+1]) cnt++; else if (array[cnt]!=array[cnt+1]) cout<<array[cnt]<<","; } else if (array[cnt]!=array[cnt+1]) cout<<array[cnt]<<","; } else if (array[cnt]!=array[cnt+1]) cout<<array[cnt]<<","; } else if (array[cnt]!=array[cnt+1]) cout<<array[cnt]<<","; } } cout<<"\b \b"; //FIND THE ODD NUMBERS cout<<endl<<"Odd Numbers\t\t\t"; for(cnt=0;cnt<15;cnt++) { if(array[cnt]%2!=0) { if(array[cnt]==array[cnt+1]) { cnt++; if(array[cnt]==array[cnt+1]) { cnt++; if(array[cnt]==array[cnt+1]) { cnt++; if(array[cnt]==array[cnt+1]) cnt++; else if (array[cnt]!=array[cnt+1]) cout<<array[cnt]<<","; } else if (array[cnt]!=array[cnt+1]) cout<<array[cnt]<<","; } else if (array[cnt]!=array[cnt+1]) cout<<array[cnt]<<","; } else if (array[cnt]!=array[cnt+1]) cout<<array[cnt]<<","; } } cout<<"\b \b"; //FIND THE PRIME NUMBERS cout<<endl<<"Prime Numbers\t\t\t"; for(cnt=0;cnt<15;cnt++) { primecount=0; for(primedivisor=1;primedivisor<=999;primedivisor++) { if(array[cnt]%primedivisor==0) primecount++; } if(primecount<=2) { if(array[cnt]==array[cnt+1]) { cnt++; if(array[cnt]==array[cnt+1]) { cnt++; if(array[cnt]==array[cnt+1]) { cnt++; if(array[cnt]==array[cnt+1]) cnt++; else if (array[cnt]!=array[cnt+1]) cout<<array[cnt]<<","; } else if (array[cnt]!=array[cnt+1]) cout<<array[cnt]<<","; } else if (array[cnt]!=array[cnt+1]) cout<<array[cnt]<<","; } else if (array[cnt]!=array[cnt+1]) cout<<array[cnt]<<","; } } cout<<"\b \b"; return 0; system("pause"); }