You are to write a program that: repeatedly requests the user to enter two sets of integers; calculates the difference between the two sets; prints the sets and the difference between them and a message indicating which set is larger.
A sample run of this program is shown at the bottom of the page, your program should print output in the same format.
Specific Requirements
Your solution must contain and use the following functions:
A function that reads a given number of integers from the keyboard into an array in dynamic memory and that returns a pointer to that array. The number of values to be read is given by the function's single integer parameter
A function that calculates and returns the sum of the values in an integer array. The function should have parameters for the array and its size.
A function that prints the contents of an integer array. The function should have parameters for the array and its size.
Sample Run:
Enter the number of values in the first set: 4
Enter 4 values
1
2
3
7
Enter the number of values in the second set: 3
Enter 3 values
1
2
3
set1 = {1,2,3,7}
set2 = {1,2,3}
set1 - set 2 = 7
The sum of set1 is larger
Press q to quit, any other key to continue: y
Enter the number of values in the first set: 5
Enter 5 values
5
4
6
3
1
Enter the number of values in the second set: 2
Enter 2 values
12
67
set1 = {5,4,6,3,1}
set2 = {12,67}
set1 - set 2 = -60
The sum of set2 is larger
Press q to quit, any other key to continue:
Enter the number of values in the first set: 3
Enter 3 values
4
5
6
Enter the number of values in the second set: 5
Enter 5 values
1
2
3
4
5
set1 = {4,5,6}
set2 = {1,2,3,4,5}
set1 - set 2 = 0
The sums of the sets are equal
Press q to quit, any other key to continue: q