Know the value of a certain digit of a multi-digit number

0

Hi, I'm a student of computer teaching and I'm watching java programming, they ask me for an exercise that asks me to determine the value of the first and last digit in a 3-digit number . Can somebody help me? How do I know the value of the third figure for example. In JAVA please

    
asked by Julián Perez 29.05.2018 в 02:24
source

1 answer

0

with the module operator (%), which returns the remainder of a division and so you can get the last digit

int numero=635; 
int ultimo=numero%10;
System.out.println(ultimo);

I hope I can help you with something

    
answered by 29.05.2018 в 02:52