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