Iterate through every index from a to b and call setbit ( ) if it is a multiple of 2 or 5
for ( let i = a ; i <= b ; i ++ ) if ( i % 2 == 0 i % 5 == 0 ) setbit ( array , i - a ) ; document . write ( " " ) ; for ( let i = a ; i <= b ; i ++ ) if ( checkbit ( array , i - a ) ) document . write ( i + " " ) ;