Pergunta de entrevista da empresa ShoreTel

A byte is passed as a parameter to a function. And starting from the Most significant position, one bit is represented as 'a', next two bits are represented as 'b', next three bits as 'c', and the last two bits and 'd', then return the decimal value of a+b+c+d.