How can you assign the binary number 101 to an integer variable?

How can you assign the binary number 101 to an integer variable?
A. Var = B101
B. Var = 101
C. Var = bin(101)
D. Var = Bin(101)
 
Answer: A
Explanation: The concept used above is a binary formatter. If this letter is associated with the number during initialization of the variable, the number is converted from that base to the base 10 which is the decimal base. This binary formatter only works for numbers which have a length of 8 bits.
 

Tìm kiếm

Back
Top