Ask Question
23 December, 09:25

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) ?

+5
Answers (1)
  1. 23 December, 09:31
    0
    Private int number = 123;

    / / using this number "123"

    int hundred = (number % 10); / / gets third to last

    number / = 10;

    int tenth = (number % 10); / / gets second to last

    number/=10;

    int ones = (number % 10); / / first digit
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Suppose you have an int variable called number. what java expression produces the second-to-last digit of the number (the 10s place) ? what ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers