TITLE: How to use the 'modulus' operator?
QUESTION [13 upvotes]: This is a problem from BdMO $2012$ Dhaka region Question Paper:

The product of a number with itself is called its square. For example,
  $2$ multiplied by $2$ is $4$, so $4$ is the square of $2$. If you take a square
  number and multiply it with itself, what will be the largest possible
  remainder if the product is divided by $10$?

I came up with this: $$x^4 \mod {10}$$
I know that the modulus (%) operator calculates the remainder of a division. And that it can be used to see, suppose, whether $N$ is a multiple of $M$ or not. Nothing more than that. I am much familiar with mod because of my programming experience with mid-level languages like C and C++. It was not until later that I came to know that modulus is used in mathematics as well.
Now, how to use  the 'modulus' operator? How can I use this to go further into solving this problem?

REPLY [9 votes]: By Fermat's Little Theorem, $x^4$ has remainder $1$ when divided by $5$; so, when divided by $10$, it could only have as remainder $1$ or $6$. The latter is achievable, e.g., by $2^4$ mod $10 \equiv 6$ as the max. QED.