We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Bitwise Operators
Bitwise Operators
Sort by
recency
|
556 Discussions
|
Please Login in order to post a comment
void calculate_the_maximum(int n, int k) { //Write your code here. int maxAND=0, maxOR=0, maxXOR=0; for(int i=1; i<=n;i++) { for(int j=i+1; j<=n; j++) { maxAND = ((maxAND < (i&j)) && (i&j) } }
printf("%d\n%d\n%d\n", maxAND,maxOR,maxXOR); }
Did anyone have trouble executing this problem? I get the correct result in a different IDE, but the same solution in this IDE is incorrect.
include
include
include
include
void calculate_the_maximum(int n, int k) { int max_and=0, max_or=0, max_xor=0; int and, or, xor; for (int a=1; a max_and) max_and = and; if(ormax_or) max_or = or; if(xormax_xor) max_xor = xor;
}
int main() { int n, k;
}
What the heck is the instructions saying? That is some serious formatting manglement.
C is a powerful and foundational programming language that has stood the test of time. Cricbet99 Register