Has reached such code:
int i, s = 0, a[10], el = -1; a[0] = 3; a[1] = -1; a[2] = 2; a[3] = 0; n = 4; for(i=0; i<n;i++){ if(a[i]==0){ el = i; } break; } for (i = el; i<n; i++){ s+=fabs(a[i]); } Label3->Show(); if (el == -1){ Label3->Caption ="В массиве 0 нет"; } else if (el == (n-1)){ Label3 -> Caption = "0 является последним элементом"; } else { Label3->Caption = "Сумма равна "+IntToStr(s); } However, when running with these numbers instead of the conceived, "0 is the last element" displays "There is no 0 in the array". Where is the error, but I do not find
break;->if () { ... }- Igor