Main.cc: In function 'int main()': Main.cc:5:10: error: 'i' was not declared in this scope cin>>i>>n; ^ Main.cc:6:19: error: expected primary-expression before ';' token for(int i=1;i<=n,;i++){ ^