text: #include <stdio.h>
  
  // sum_squares(a,b) returns sum of the squares of numbers from a to b
  int sum_squares(int a, int b) {
  	int sum = 0;
  	for (int i = a; i <= b; ++i) {
  		sum += (i*i);
  	}
  	return sum;
  }
  
  // square_sums(a,b) returns square of the sums of numbers from a to b
  int square_sums(int a, int b) {
  	int sum = 0;
  	for (int i = a; i <= b; ++i) {
  		sum += i;
  	}
  	return sum*sum;
  }
  
  // difference(a,b) returns the difference between the sum of squares and 
  //   square of sums for numbers from a to b
  int difference(int a, int b) {
  	int diff = sum_squares(a,b) - square_sums(a,b);
  	if (diff < 0) {
  		return diff * -1;
  	} else {
  		return diff;
  	}
  }
  
  int main(void) {
  	int a, b, sum_square_difference;
  
  	printf("Find difference between sum of squares and square of sums\n");
  	printf("   for numbers from a to b when ...\n");
  	printf("a = ");
  	scanf("%d", &a);
  	printf("b = ");
  	scanf("%d", &b);
  
  	sum_square_difference = difference(a,b);
  
  	printf("sum square difference = %d\n", sum_square_difference);
  	return 0;
  }
  