You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For question no 16.c of arrays there is a minor issue in Method 3
int findEquilibriumIndex(int a[],int n){
int i = 0,j;
int sum = 0, sumLeft = 0;
for(i=0; i<n; i++){
sum += a[i];
}
for(j=0;j<n;j++){
sum = sum - a[j];
**sumLeft += a[j];** //Should have come after if condition
if(sum == sumLeft){
return j;
}
}
return 0;
}
The text was updated successfully, but these errors were encountered:
For question no 16.c of arrays there is a minor issue in Method 3
int findEquilibriumIndex(int a[],int n){
int i = 0,j;
int sum = 0, sumLeft = 0;
}
The text was updated successfully, but these errors were encountered: