Math Fundamentals18 sections · 814 units
Open in Course

Problem - Last Digit

Using modulo 10

Given a positive integer nn, find its last digit. For example, the last digit of 1234512345 is 55.

This seems simple, but it teaches you a pattern used everywhere: extracting digits using modulo and division.

Try to solve it yourself first. What operation gives you the last digit?