/* CSE 333 Su12 Lecture 3 demo: sum_fragment.c */
/* Gribble/Perkins */

/* sumTo function used in several other examples */

// Return sum of integers from 1 to max
int sumTo(int max) {
  int i, sum = 0;
  
  for (i=1; i<=max; i++) {
    sum += i;
  }
  return sum;
}