Following are not allowed to use 1) Arithmetic and Comparison Operators 2) String functions We strongly recommend you to minimize your browser and try this… Read More »
A magic number is defined as a number which can be expressed as a power of 5 or sum of unique powers of 5. First… Read More »
Given an integer n and two bit positions p1 and p2 inside it, swap bits at the given positions. The given positions are from least… Read More »
Given an integer, write a function that calculates ⌈7n/8⌉ (ceiling of 7n/8) without using division and multiplication operators.
Write a function subtract(x, y) that returns x-y where x and y are integers. The function should not use any of the arithmetic operators (+,… Read More »
Given an integer n, calculate square of a number without using *, / and pow(). Examples: Input: n = 5 Output: 25
A Bitwise And operator is represented as ‘&’ and a logical operator is represented as ‘&&’. Following are some basic differences between the two operators.
In C, we can specify size (in bits) of structure and union members. The idea is to use memory efficiently when we know that the… Read More »
Write a function which returns 1 that 2 is passed and return 2 when 1 is passed.
Given an integer ‘x’, write a C function that returns true if binary representation of x is palindrome else return false.
A nibble is a four-bit aggregation, or half an octet. There are two nibbles in a byte.
Difficulty Level: Rookie Given a number n and a value k, turn of the k’th bit in n.
Given a number n, write a function that returns true if n is divisible by 9, else false. The most simple way to check for… Read More »
In C, following 6 operators are bitwise operators (work at bit-level)
Given two variables, x and y, swap two variables without using a third variable.