1.

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)I had been asked this question in examination.This question is from Datatypes topic in section Arduino Programming of Arduino

Answer»

Right answer is (a) Var = B101

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.



Discussion

No Comment Found

Related InterviewSolutions