Question: 2. Write a simple library and a makefile to make the following codes. a. Your library consists of 3 functions: i.add(x,y): adds integers x and

2. Write a simple library and a makefile to make the following codes. a. Your library consists of 3 functions: i.add(x,y): adds integers x and y ii. multiply(x,y): multiplies integers x and y iii. factorial(x): calculates x factorial b. Write each function to a different file: add(), multiplyo, factorial() functions in files add.c, mult.c, fact.c respectively. c. Write a main program named proglc to read a,b,c and calculate a*b+c! using your library functions d. Write a makefile i. Write 3 rules to make add.o, mult.o, fact.o i. Write a rule to make the executable progl.exe e. First run the rules to make your library (add.o, mult.o, fact.o). Then run the rule to make your program. f. Run the executable code and check the result. g. Submit all your codes, and screenshots
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
