Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Pls code this in C 7.3 Primes 7.3.1 Problem Given a number, print all of its prime factors. 7.3.2 Preconditions You must provide a single

Pls code this in C

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 must provide a single function which meets the requirements in the table below. You you may include other func- tions as long as the requested function executes correctly. Do not include a main function in your source or header files. All positive numbers greater than 2 can be factored in such a way that their factors are a series of prime numbers. For example, the prime factorizations up to 20 are: Number Prime Factorization 3 3 2*2 6 2 73 7 7 8 2#2*2 9 3 * 3 10 2*5 11 11 12 2 *2 *3 13 13 14 2 * 7 15 3 *5 16 2 *2 *2*2 17 17 18 2 *3 *3 19 19 20 2* 2 * 5 Requirement Conditions Function void primes(long) Input Parameters A long integer greater than 2. Return Value Your function should not return a value. Files Required primes.c, primes.h 7.3.3 Postconditions Your function must output to the standard output stream. The output must print all of the primes in the input's prime factorization. The factors must be in the order of smallest prime to largest, and every number should have a single space after it. The output should then be terminated with a newline character. 7.3.4 Restrictions You may not use any structs or manual memory allocation. We have not learned pointers yet, but you may feel free to use them. 7.3.5 File Requirements This contract requires you to provide a C source file named primes.c and a C header file named primes.h. Your header file should contain your forward declarations. Your source file must not contain a main function, or it will fail during marking

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_2

Step: 3

blur-text-image_3

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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions