Union, intersection, membership, subset and difference need to be implemented. For union, intersection, difference and subset, the input is the names of two files. Each file contains the integers that are part of the set, one number per line. You have to read these numbers from the file which gives you the set membership. The numbers will be in the range [1..64] as we represent the set as a long integer of size 64 bits. Make this a function as part of modularity. Also write a function to print the members of a set so that the final set can be printed for union, intersection, subset and difference. The return value from the functions in membership and subset is a boolean that returns TRUE (1) if true and FALSE (0) if false. For union, intersection and difference, the parameters to the functions are the two sets and the output is the union/intersection/difference set. The return value from these functions is the number of elements in the output set. Write a function to write the members of a set to an output file. This function is called by the union/intersection/difference functions to print the output set.
Create a different file called union.c, intersect.c etc (meaningful file names which allow us to know what each file contains). Also, create a file called mylib.c which contains the functions to read and write files, ismember function and any other functions needed by more than one of the set operations. Link the mylib.o with your source files and create executables union, intersect etc. In your Makefile, have a target called all that builds all your exectuables. Also, have a target clean which removes all your object and executable files.