Tag: Bitwise

Making Binary Numbers

Problem Given four binary digits all ones 1111 and two binary digits all zeros 00 we need to create a six digit binary number using these ones and zeros such that no two zeros are next to each other. How many binary numbers we can make. For example 011110 is correct while 110011 is not

Bitwise operators in c++

Problem Write a C++ function that takes a character as input and returns true if the second significant bit of the binary representation of the character is set (i.e equals to 1) otherwise return false. Solution This is a bitwise operations problem. First you need to shift the character one digit to the right then