Check out example codes for "find last digit of number". It will help you in understanding the concepts better.

Code Example 1

//C++
int last_digit = number % 10;

Learn ReactJs, React Native from akashmittal.com