O'Reilly logo
  • Brandon Reeser thinks this is interesting:

int triangle(int n) {
    int total = 0;
    while (n-- > 0)
         total += n;
    return total;
}

From

Cover of C++ for the Impatient

Note

test