Program to find the last digit of X in base Y | C ++ Program to find the last digit of X in base Y ; Function to find the last digit of X in base Y ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; void last_digit ( int X , int Y ) { cout << X % Y ; } int main ( ) { int X = 55 , Y = 3 ; last_digit ( X , Y ) ; return 0 ; }