Print all submasks of a given mask | Function to print the submasks of N ; Driver Code
function SubMasks ( N ) { for ( let S = N ; S > 0 ; S = ( S - 1 ) & N ) { document . write ( S + " " ) ; } } let N = 25 ; SubMasks ( N ) ;