Arithmetics
The modulus operator in C++ is %
.
This line prints out number
modulo 5
(the remainder of number
divided by 5
):
std::cout << number % 5 << std::endl;
Make the program prints out the last digit of the input number
.
1234
4