text: Count numbers with unit digit k in given range | Returns count of numbers with k as last digit . ; Driver Code
code: function counLastDigitK ( low , high , k ) { let count = 0 ; for ( let i = low ; i <= high ; i ++ ) if ( i % 10 == k ) count ++ ; return count ; } let low = 3 ; let high = 35 ; let k = 3 ; document . write ( counLastDigitK ( low , high , k ) ) ;