Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

7.3 Primes 7.3.1 Problem Given a number, print all of its prime factors: 7.3.2. Preconditions You mest poovide a single fubction which mects the requirements

image text in transcribed
image text in transcribed
7.3 Primes 7.3.1 Problem Given a number, print all of its prime factors: 7.3.2. Preconditions You mest poovide a single fubction which mects the requirements in the table below. You maxy inclode othr func- All positive muabes greater than 2 cas be factorve in such a way that their factues ase a srimen of pritine nubbers. Foe exanaple, the prime fuctorizations ap to 20 are: 7.3.3 Postconditions Your function nust output to the standard ontput strowm. The output must print all of the primes in the inpet's ptime factoeitation. The fartors nuse tee in the ceder of nmalkot prime to largest, and every nembers ahoald have a single space after it. The outpat should then be teruinated with n newline charactes. 7.3.4 Reatrictions You may not ese aigy strocts or madeal tactoery allocatioe. We have act learned pointers yet, but you may fisel frve. to we then. 7.3.5 File Requirements This contract requires you to provide a C soure file nasal primesse and a C beader file named primes.h. Your hesder tile shoald contain your forward declarations. Your source file mint not contain a main functioe, ot it will fail during testing Your source and beader fills should be placed in the Lab3/primes/ directory in your GitLab repository. 7.3.6 Testing To test your code, you can compile your source file with the primesMoobjeet file found in CI/objects/primes/. It eai thro be exceuted as sormal. 7.3.7 Sample Inputs and Outputs 14 of 18 I pocitive numbern groater thas 2 can lo factored in such a way that their facteen are a serirs of prime eumbers. For example, the prime factorixations up to 20 are 7.3.3 Pastconditions Your fouction must output to the standard output wtreams. The outpus mast prime all of the ptimies in tho inprit is peime factoriasion. The factore must be in the cover of smallost jeime to largot, and every bumber alaulal have a aingle mace after is. The eatput should then be teriainated mith a newline character. 7.3.4 Rentrietioas You may bot det asy structs of mataial mezuery allocatica. We have not learecd pointern yet, but you may fecl fret to twe then. 7.3,5 File Requirements This contract requites you to peowide a C soares tibe samerd primes.e abd a C beaser file babed primaes.ls. Your healer file should contain your forkaril dexlaratiots. Your senere file usust not oontain a main functiou, or it will fail durings testing. Your source anul beader files shondul be placed in the Lab3/primes/ directory in your GitLab reponitory. 7.3.6 Testing To test your codr, you cen compele your sontrce fle with the primaesM.o object file foumd in CI/objects/primes/. It can then be rocecuted as normal. 7.3.7 Sanple Imputs and Outputs

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Define independent and dependent variables

Answered: 1 week ago

Question

On balance, which feels more familiar to you? More appealing?

Answered: 1 week ago