text: Print bitwise AND set of a number N | function to find bitwise subsets Efficient approach ; Driver Code
code: < ? php function printSubsets ( $ n ) { for ( $ i = $ n ; $ i > 0 ; $ i = ( $ i - 1 ) & $ n ) echo $ i . " " ; echo "0" ; } $ n = 9 ; printSubsets ( $ n ) ; ? >