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](https://s3.amazonaws.com/si.experts.images/answers/2024/09/66db0da2223b3_90566db0da180408.jpg)
"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. // 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
Get step-by-step solutions from verified subject matter experts
