Check if any large number is divisible by 19 or not | Function to check if the number is divisible by 19 or not ; Extracting the last digit ; Truncating the number ; Adding twice the last digit to the remaining number ; return true if number is divisible by 19 ; Driver code
< ? php function isDivisible ( $ n ) { while ( 1 ) { $ d = $ n % 10 ; $ n = $ n / 10 ; $ n = $ n + $ d * 2 ; if ( $ n < 100 ) break ; } return ( $ n % 19 == 0 ) ; } $ n = 38 ; if ( isDivisible ( $ n ) ) echo " Yes " ; else echo " No " ; ? >