Assuming that the V variable holds an integer value to 2, which of the following operators should be used instead of OPER to make the expression equal to 1?
V = 2 # Assigns the value of 2 to variable V
print(bin(V)) # Prints the current value of V in binary
print(V) # Prints the current value of V in decimal
V = V >> 1 # Checking the new value of V after the bitwise right shift of int(2) i.e (from 0b10 to 0b01)
print(bin(V)) # Prints the new value of V in binary
print(V) # Prints the new value of V in decimal
OUTPUT
0b10
2
0b1
1
Hence, the answer is C
This section is not available anymore. Please use the main Exam Page.PCAP Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
apextek1
Highly Voted 5 years, 3 months agoDamon54
Most Recent 1 year, 5 months agoNetspud
2 years, 4 months agomacxsz
3 years, 2 months agorocky48
3 years, 4 months agorbishun
3 years, 8 months agoFR99
4 years, 8 months agoimsaad
4 years, 11 months agosacnar
4 years, 11 months agojohn_bosco_champion
4 years, 11 months agoimsaad
4 years, 11 months agoguillepowermetal
5 years agoAmritansh
5 years, 1 month ago