x=x+v;
x += v;
x+=1;
x ++;
Thus:
int sum(int n) { int result = 0; for (int counter=1; counter<=n; counter++) result += counter; return result; }