Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2a74cd4 commit d685b4bCopy full SHA for d685b4b
BitManipulation/Checking_power_of_2/isPowerOf4.cpp
@@ -0,0 +1,11 @@
1
+#include <iostream>
2
+using namespace std;
3
+
4
+bool isPowerOfFour(int num) {
5
+ return (num > 0) && !(num & (num - 1)) && !((num - 1) % 3);
6
+}
7
8
+int main() {
9
+ cout << isPowerOfFour(64) << endl;
10
+ return 0;
11
0 commit comments