Find Prime Factors of a Number

Learn to use sieve to find the factors of a given number.

We'll cover the following

Factorization of a number problem

Let us now take a problem in which you need to print all the factors of a number. For example, if we have N = 12, the output would be the factors of 12, which are 2, 3. Look at the visual below to get an idea about the approach that we will be taking.

Level up your interview prep. Join Educative to access 80+ hands-on prep courses.