Question: test1.c mth3.h 1. [10 points] In cfact.c, provide an implementation in C for a function with the following specification: Listing 1: Specification of printFactors. //

 "test1.c" "mth3.h" 1. [10 points] In cfact.c, provide an implementation in

"test1.c"

C for a function with the following specification: Listing 1: Specification of

"mth3.h"

printFactors. // precondition: num >=1 // prints factors of num void printFactors

1. [10 points] In cfact.c, provide an implementation in C for a function with the following specification: Listing 1: Specification of printFactors. // precondition: num >=1 // prints factors of num void printFactors (int num); If given argument 1329, it should print factors in numeric sequence in this format: 13 4431329 In primes.c, provide an implementation in C for a function with the following specification: Listing 2: Specification of isPrime. //precondition: x>=2 //if x is prime, returns 1, otherwise returns 0 int isprime(int x ); Compile both these source files separately to generate object files and then package the object files in a static library named libmathCU. a. Note: Use the gcc flag fPIC to generate position independent code. You also might need to use specify std=c11 to get newer C constructs (such as loop initialization declarations) to compile. Test your library file using test1.c and mth3.h, and verify that it is the same as the expected output shown in Listing 3. In readme.txt, write the following: - the commands you used to generate the static library - the command(s) used to run the provided driver test1.c using your library on Polaris, and the output obtained //precondition: x>=2 //if x is prime, returns 1 , otherwise returns 0 int isprime (int x ); // precondition: num >=1 // prints factors of num void printFactors (int num)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!