840 is divisible by the prime number 2 which results in 420. The same step can be applied 2 more times and the resultant value will be 105. Continuing, the number 105 is divisible by prime number 3 and the result after division will be 35. Continuing, the number 35 is divisible by prime number 5 and the result after division will be 7. The result 7 cannot be divided any further as it is a prime number. Hence the prime factors of 840 are 2, 2, 2, 3, 5, 7.

840 is divisible by the prime number 2 which results in 420. The same step can be applied 2 more times and the resultant value will be 105. Continuing, the number 105 is divisible by prime number 3 and the result after division will be 35. Continuing, the number 35 is divisible by prime number 5 and the result after division will be 7. The result 7 cannot be divided any further as it is a prime number. Hence the prime factors of 840 are 2, 2, 2, 3, 5, 7.