adspace


Which bit wise operator is suitable for turning off a particular bit in a number?

Answer Posted / Braj Mohan Munduia

The bitwise NOT (~) operator or the bitwise AND with ones complement (& ~mask) can be used to turn off a particular bit in a number. If you want to clear the n-th bit, you would perform a bitwise AND with a mask that has a 1 in every position except for the n-th position.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can union be self referenced?

1267


How c functions prevents rework and therefore saves the programers time as wel as length of the code ?

1165


What character terminates all character array strings a) b) . c) END

1397


What is the latest version on c++?

1209


daily Routine of father

1485