Sort by

recency

|

556 Discussions

|

  • + 0 comments

    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); }

  • + 1 comment

    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.

  • + 0 comments

    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;

        }
    }    
    printf("%d\n%d\n%d",max_and,max_or,max_xor);
    

    }

    int main() { int n, k;

    scanf("%d %d", &n, &k);
    calculate_the_maximum(n, k);
    
    return 0;
    

    }

  • + 1 comment

    What the heck is the instructions saying? That is some serious formatting manglement.

  • + 0 comments

    C is a powerful and foundational programming language that has stood the test of time. Cricbet99 Register