Main.cc: In function 'int main()': Main.cc:32:16: warning: operation on 'sum' may be undefined [-Wsequence-point] sum=sum+=a[i]; ^ Main.cc:33:3: error: 'mx' was not declared in this scope mx=sum/n; ^