Main.cc: In function 'int main()': Main.cc:6:2: error: 'a' was not declared in this scope a=1*2+2*3+3*4+4*5+5*6+6*7+7*8+8*9; ^