Which of these expressions will make the rightmost set bit zero in an input integer x?

Question:Which of these expressions will make the rightmost set bit zero in an input integer x?

1. x = x | (x-1)

2.x = x & (x-1)

3.x = x | (x+1)

4.x = x & (x+2)


Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!