We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent abf0e61 commit d39a599Copy full SHA for d39a599
get_or_remove_least_significant_bit.cpp
@@ -0,0 +1,9 @@
1
+#include <iostream>
2
+using namespace std;
3
+
4
+int main() {
5
+ int x = 6;
6
+ cout << "remove " << x << "'s least significant bit: " << (x & (x-1)) << endl;
7
+ cout << x << "'s least significant bit: " << (x & (~(x-1))) << endl;
8
+ return 0;
9
+}
0 commit comments