Challenge: Prime Factor
Check your understanding of prime factors.
We'll cover the following
Problem statement
Prime factors are the combinations of the smallest prime numbers that, when multiplied together, will produce the original number. Consider the following examples:
Prime factors of
are: Prime factors of
are: Prime factors of
are: Prime factors of
are: Prime factors of
are:
Implement your solution in three projects created for you:
A class library in the
PrimeFactorsLib
project with a static class and static method namedPrimeFactors
that, when passed anint
variable as a parameter returns astring
showing its prime factors.A unit test in the unit test project named
PrimeFactorsTests
with a few suitable unit tests.A console application to use in the
PrimeFactorsApp
project.
To keep it simple, assume that the largest number entered will be
Expected output
The result of running your console app should look something like this:
Get hands-on with 1400+ tech skills courses.