Tag Archives: 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 …

Read more »

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 …

Read more »

Swap variables interview question

Swapping two variables without a temp Given two integer variables A and B. Write C++ code to swap them without using a temporary variable. Solution This is a well known problem for which you can find so many references on …

Read more »