Main.cc: In function 'int sum(int)': Main.cc:6:12: error: 'i' was not declared in this scope a = a*i; ^