Main.cc: In function 'int main()': Main.cc:17:14: error: expected ';' before '}' token } ^ Main.cc:8:27: warning: unused variable 'x' [-Wunused-variable] int i = 0,j,sum = 0,n,x; ^