Print bitwise AND set of a number N | Function to find bitwise subsets Efficient approach ; Driver code
function printSubsets ( n ) { for ( let i = n ; i > 0 ; i = ( i - 1 ) & n ) document . write ( i + " " ) ; document . write ( " " + " " ) ; } let n = 9 ; printSubsets ( n ) ;