And operator able to perform bitwise shifts is coded as (Choose two.)
And operator able to perform bitwise shifts is coded as (Choose two.)
The bitwise shift operators are '<<' for left shift and '>>' for right shift. The '<<' operator shifts the bits of a number to the left, effectively multiplying the number by 2 for each shift position. The '>>' operator shifts the bits to the right, effectively dividing the number by 2 for each shift position. Both '++' and '--' are not bitwise operators; they are unary operators used for incrementing and decrementing values, respectively.
C. << D. >>
x = 8 # 8 in Binary: 1000 y = x >> 2 # Right shift by 2 positions: 0010 (in binary) which is 2 in decimal print(y) # Output: 2 x = 4 # 4 in Binary: 0100 y = x << 2 # Left shift by 2 positions: 10000 (in binary) which is 16 in decimal print(y) # Output: 16
C and D
The answers are C and D.
Answer is C,D
C. << d. >>
C. << D. >>
>> right shift between integer value (division by 2) <<left shift (multiplication by 2)
>>Desplazamiento a la derecha bit a bit << Desplazamiento a la izquierda bit a bit