how to get last digit of a number in java code example
Example 1: find last digit of number
//C++
int last_digit = number % 10;
Example 2: how to find last digit in number by regex in java
(\d+)(?!.*\d)
//C++
int last_digit = number % 10;
(\d+)(?!.*\d)