Qualcomm Interview Question

How to write a bitmask function in C