Garmin Interview Question

Write a function to apply a bit mask.