Main.cc: In function 'int main()': Main.cc:6:9: error: 's' was not declared in this scope s = n*(n+1)/2; ^