Using C language, write a program that will display the menu as shown below. Write a function for each item in the menu except the last one.
MENU
a] CARDINAL NUMBER OF A SET
b] UNION OF SETS
c] INTERSECTION OF SETS
d] DIFFERENCE OF 2 SETS
e] COMPLEMENT OF A SET
f] QUIT
Enter choice:
Test Cases:
a] Cardinal Number of a Set
Example: Set A ={1, 4, 0, -3, -1, 3, 17}
Cardinal Number of Set A = 7
b] Union of Sets
Example:
Set A ={1, 4, 0, -3, -1, 3, 17}
Set B = {2, 4, 6, 8, 10}
A Ս B = {0, 1, -1, 2, 3, -3, 4, 6, 8, 10, 17}
c] Intersection of Sets
Example:
Set A ={1, 4, 0, -3, -1, 3, 17}
Set B = {2, 4, 6, 8, 10}
A Ո B = {4}
d] Difference of Two Sets
Example:
Set A ={1, 4, 0, -3, -1, 3, 17}
Set B = {2, 4, 6, 8, 10}
A – B = {0, 1, -1, 3, -3, 17}
B – A = {2, 6, 8, 10}
e] Complement of a Set
Example:
U = {1, 2, 3, 4, 5, 6, 7 , 8, 9, 10}
Set A ={1, 4, 3, 8, 9}
A’ = {2, 5, 6, 7, 10}