If for example I have four arrays (with different value), and I have another array which is the result of calculation between these four arrays. Then, I can sort the final array to ascending order and I want to search from the four arrays that can result the sorted final array...
I used do while loop but I guess something wrong with it because it keep resulting 0.
Here's my a part of code which has problem:
Could you help me spot the error, please?
I used do while loop but I guess something wrong with it because it keep resulting 0.
Here's my a part of code which has problem:
Code:
for (i=0; i<size2; i++){
for (k = 0; k < point3[i]; k++){
for (a=0;a<b[i][k];a++){
for (l=0;l<b[i][k];l++){
do{
gradient [i][k][a]= fabs((S[i][k][j]-Cy[i][k])/(R[i][k][j]-Cx[i][k]))-teta[i][k][a];
//teta[i][k][a] = fabs((S[i][k][a]-Cy[i][k])/(R[i][k][a]-Cx[i][k])),but in the statement above teta[i][k][a] has already sorted
X[i][k][a]=R[i][k][l];
Y[i][k][a]=S[i][k][l];
}
while (gradient[i][k][a]==0);
}
printf ("[%d][%d][%d]=%f\n",i,k,a,X[i][k][a]);
}
}
}
Comment