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