1 2 3 4 5 6 7 8 9
int n = arg; if( n < 0 ) n = -n; int sum = 0; int i = 0; while( i < n ) { i = i + 1; sum = sum + i; } return sum;