PCAP Exam QuestionsBrowse all questions from this exam

PCAP Exam - Question 2


And operator able to perform bitwise shifts is coded as (Choose two.)

Show Answer
Correct Answer: CD

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.

Discussion

9 comments
Sign in to comment
zaxxyOptions: CD
May 23, 2022

C. << D. >>

AndresfvOptions: CD
Mar 4, 2022

>>Desplazamiento a la derecha bit a bit << Desplazamiento a la izquierda bit a bit

chafikislamOptions: CD
Mar 12, 2022

>> right shift between integer value (division by 2) <<left shift (multiplication by 2)

macxszOptions: CD
May 2, 2022

C. << D. >>

DinshaOptions: CD
Mar 8, 2023

C. << d. >>

DrMKGOptions: CD
May 24, 2023

Answer is C,D

mplopezOptions: CD
Jul 22, 2023

The answers are C and D.

saturn_samOptions: CD
Sep 8, 2023

C and D

BereOptions: CD
Oct 26, 2023

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