Arithmetics

3.4 - Modulus


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;

Task

Make the program prints out the last digit of the input number.

Sample input

1234

Sample output

4
#include <iostream> int main() { int number; std::cin >> number; // Start your code here! }