Skip to content

Instantly share code, notes, and snippets.

@McLarenCollege
Last active August 24, 2021 09:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save McLarenCollege/77f64ca3b87c4e000627998f315141a8 to your computer and use it in GitHub Desktop.
Save McLarenCollege/77f64ca3b87c4e000627998f315141a8 to your computer and use it in GitHub Desktop.
Print Prime Factors

Print all the prime factors of a given number. A Prime factor is a number which is prime and is factor of the given number.

function printPrimeFactors(num){
// write your code here
}

printPrimeFactors(6);// should print 2 3
printPrimeFactors(11);// should print 11
printPrimeFactors(100);// 2 5
printPrimeFactors(300);// 2 3 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment