Program to find the last digit of X in base Y | Function to find the last digit of X in base Y ; Driver code
< ? php function last_digit ( $ X , $ Y ) { echo ( $ X % $ Y ) ; } $ X = 55 ; $ Y = 3 ; last_digit ( $ X , $ Y ) ; ? >