Ruby program to clear the specific bit using the bitwise operator

bookmark

num=12

num = num & ~(1<<3)

print "Num: ",num

 


Output:

Num: 4