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

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

except that it is an inline element. That means it does not start on a new line. The final result should look something like this: Frst Number:100 Second Number 200 Find total of primes Give Me Primes 101,103,107,109,113,127,1 1137.139 149151 157 63 16773,179,182191,193,197,9 Primes total is: 3167

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!