Bit twidling
How will you find minimum of three integers without using any comparison operator ?
Given an array of numbers find the maximum XOR value of two numbers in the array. Input Array = {12, 15, 5, 1, 7, 9, 8, 6, 10, 13}; Output = 15 (XOR of 5 and 10) 5 = 0101 10 = 1010 ——— XOR = 1111
Write a C function to compute xn which uses minimum number of multiplications. unsigned int power(double x, unsigned int n)
Given an unsigned int n, find the integer greater than or equal to n which is a power of 2. For example: Input Output —– —— 6 8 12 16 64 64
Write a function that accepts two unsigned int and return sum of these two integers. The function should not use any arithmetic operator (mayuse bitwise operators only).
Given two unsigned integers, find the larger (or smaller) of the two without using branching (if-else or conditional operator).
Given an Array of two elements one of which is 0, the other is either 0 or 1. You have to make both the elements of array 0. But following are the constraints:
How will you check if a number if a power of two or not? For example: 4, 8, 1024 etc are powers of two. But 6, 40, 95 etc are not
Give a method to find whether an integer is a power of 4 or not.
How will you turn off the rightmost bit in the binary representation of an unsigned int number.