Split a two-digit number 🌶️
The variable number holds a two-digit whole number. The two locked lines at the bottom print a variable named tens and then a variable named ones, which you have to create. Write the code in the box that declares each one as an int: tens should be the digit in the tens place (47 has a 4 there) and ones the digit in the ones place (47 has a 7). Use the / and % operators! Your code will be tested with several different numbers.
Dividing an int by 10 throws away the ones digit, leaving the rest. The remainder after dividing by 10 is exactly the ones digit.