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