1) Name your program sets.c.

2) The program will read in the number of element in the first set, for example, 4, then

read in the numbers in the set, for example, 3 6 8 9. The repeat for the second set. The

two sets do not necessarily are of the same size.

3) The sets are stored using arrays of 0s and 1s as described above.

4) Calculate the union and intersection of the two sets and display the result.

code:

int main(void) { int i, j, A, B; int temp_a = 0; int temp_b = 0; //Prompts user for size and values of array A and B printf("Please enter the number of elements in set A: "); scanf("%d" , &A); int a[A]; printf("Enter the numbers in set A: "); for (i = 0; i < A; i++) scanf("%d", &a[i]); //For-loop to organize user input for array A into an ascending order for (i = 0; i < A; i++) { for (j = i + 1; j < A; j++) if (a[i] > a[j]) { temp_a = a[i]; a[i] = a[j]; a[j] = temp_a; } } printf("Please enter the number of elements in set B: "); scanf("%d", &B)/>; int b[B]; printf("Enter the numbers in set B: "); for (i = 0; i < B; i++) scanf("%d", &b[i]); //For-loop to organize user input for array B into ascending order for (i = 0; i < B; i++) { for (j = i + 1; j < B; j++) if (b[i] > b[j]) { temp_b = b[i]; b[i] = b[j]; b[j] = temp_b; } } //Calls function printUnion to get union of A and B arrayUnion(a, b, A, B)/>; arrayIntersection(a, b, A, B)/>; return 0;