Question: 1 Write a function to decompose a number and return the sum of its composing numbers. For example, for the number 239 the function should
1 Write a function to decompose a number and return the sum of its composing numbers. For example, for the number 239 the function should return 14 because 2+3+9-14. Tip: Consider this as a challenge for your brain on logical reasoning! I can tell you though that you will need a "while" loop and the modulus "% operator. 2- Using the function you defined in the first exercise, check if the returned number is a prime number. 3- If the returned number is a prime, then this number should be styled in red and bold Tip: Don't forget that what you set in the innerHTML of an element is HTML code. So writing this is totally fine: document.getElementById("myDiv"). innerHTML+
Some text
" Also, you may use a new HTML element, . Do some research on it! A is similar to a
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
