Main.cc: In function ‘int cal(int, int)’: Main.cc:9:15: warning: left operand of comma operator has no effect [-Wunused-value] for(int i=x;i<=y,i++){ ~^~~ Main.cc:9:22: error: expected ‘;’ before ‘)’ token for(int i=x;i<=y,i++){ ^ Main.cc:12:1: warning: no return statement in function returning non-void [-Wreturn-type] } ^ Main.cc: In function ‘int main()’: Main.cc:17:8: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d",&d[i]); ~~~~~^~~~~~~~~~~~