36.8k views
3 votes
Suppose you have an int variable called number. What Java expression produces the second-to-last digit of the number (the 10s place)? What expression produces the third-to-last digit of the number (the 100s place)? (Note: Our code checker won't match every possible expression; please come up with the simplest expression using division and modulus.)

User Seberg
by
4.3k points

1 Answer

5 votes

Answer:

(number%100) / 10

(number%1000) / 100

Step-by-step explanation:

User Axois
by
4.8k points