If bit position is found set , we flip this bit by xoring given number and number with bit position set
n = n ^ ( 1ll << bit ) ; break ; } } cout << " The ▁ number ▁ after ▁ unsetting ▁ the " ; cout << " ▁ rightmost ▁ set ▁ bit ▁ " << n ; }