CS360 Midterm Exam: March 2, 2004. Answer to Question 4

Here is a reasonable C program that would produce this code:
a(int a, int b, int *p)
{
  int i, total;

  total = 0;
  for (i = a; i < b; i++) {
    total += i;
  }
  *p = total;
}