In this challenge, you will use logical bitwise operators. All data is stored in its binary representation. The logical operators, and C language, use to represent true and to represent false. The logical operators compare bits in two numbers and return true or false, or , for each bit compared.
Bitwise AND operator & The output of bitwise AND is 1 if the corresponding bits of two operands is 1. If either bit of an operand is 0, the result of corresponding bit is evaluated to 0. It is denoted by &.
Bitwise OR operator | The output of bitwise OR is 1 if at least one corresponding bit of two operands is 1. It is denoted by |.
Bitwise XOR (exclusive OR) operator ^ The result of bitwise XOR operator is 1 if the corresponding bits of two operands are opposite. It is denoted by .
You will be given an integer , and a threshold, i1nnik$. Print the results of the and, or and exclusive or comparisons on separate lines, in that order.
The results of the comparisons are below:
For the and comparison, the maximum is . For the or comparison, none of the values is less than , so the maximum is . For the xor comparison, the maximum value less than is . The function should print:
Complete the calculate_the_maximum function in the editor below.
calculate_the_maximum has the following parameters:
int n: the highest number to consider
int k: the result of a comparison must be lower than this number to be considered
Print the maximum values for the and, or and xor comparisons, each on a separate line.
The only line contains space-separated integers, and .
Sample Input 0
Sample Output 0
All possible values of and are:
The maximum possible value of that is also is , so we print on first line.
The maximum possible value of that is also is , so we print on second line.
The maximum possible value of that is also is , so we print on third line.