text: Efficiently check whether n is a multiple of 4 or not | C ++ implementation to efficiently check whether n is a multiple of 4 or not ; function to check whether ' n ' is a multiple of 4 or not ; if true , then ' n ' is a multiple of 4 ; else ' n ' is not a multiple of 4 ; Driver program to test above
code: #include <bits/stdc++.h> NEW_LINE using namespace std ; string isAMultipleOf4 ( int n ) { if ( ( n & 3 ) == 0 ) return " Yes " ; return " No " ; } int main ( ) { int n = 16 ; cout << isAMultipleOf4 ( n ) ; return 0 ; }