int sum(int a, int b)
{
  int i;
  int x = 0;

  for(i = a; i <= b; i++) 
  {
    x = x + i;
  }
  return x;
}