Hello

I am new new Java, and would like some help in a exercise I am trying. I would like to know how to get java to print out the "Hundredth" number in a number.
ie in the number 1234 how would I get java to print out that 2 is the 'hundredth' number?

thanks in advanced
ray

you can compute it by dividing by 100 (removes the last 2 digits) and then mod'ing by 10 (only keeps the last digit)
(x / 100) % 10

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.