I am making a JavaScript app that calculates the result of two numbers multiplied. How do I show the components of a number? For example, number = 123. hundreds = 1, tens = 2, ones = 3.
You can use a while loop in which it checks until the number becomes zero. You can take the mod with 10 of the number and divide it by 10.