Driver Code to test above functions
public static void main ( String args [ ] ) { int L = 1 , R = 1000 ; K = 3 ; System . out . println ( countInRange ( R ) - countInRange ( L - 1 ) ) ; L = 9995 ; R = 10005 ; K = 2 ; System . out . println ( countInRange ( R ) - countInRange ( L - 1 ) ) ; } }