## Binary to Gray code using recursion

Given Binary code of a number as a decimal number, we need to convert this into its equivalent Gray Code. Examples : Input : 1001… Read More »

Given Binary code of a number as a decimal number, we need to convert this into its equivalent Gray Code. Examples : Input : 1001… Read More »

Given n, find the greatest number which is strictly not more then n and whose binary representation consists of m consecutive ones, then m-1 consecutive… Read More »

The problem is to check whether the decimal representation of the given binary number is divisible by 10 or not. Take care, the number could… Read More »

Given two integers ‘L’ and ‘R’, we need to write a program that finds the count of numbers having prime number of set bits in… Read More »

Given a binary input that represents binary representation of positive number n, find binary representation of n-1. It may be assumed that input binary number… Read More »

Given two integers n and m. Find the longest contiguous subset in binary representation of both the numbers and its decimal value. Example 1: Input… Read More »

Given a positive number you need to check whether it’s complement and the number are anagrams or not. Examples: Input : a = 4294967295 Output… Read More »

Given a number n, our task is to find all 1 to n bit numbers with no consecutive 1s in their binary representation. Examples: Input… Read More »

Given a decimal number as input, we need to write a program to convert the given decimal number into equivalent binary number. Examples: Input :… Read More »

Given a binary number as input, we need to write a program to convert the given binary number into equivalent decimal number. Examples: Input :… Read More »

Given a binary array arr[], we to find the number represented by the subarray a[l..r]. There are multiple such queries. Examples: Input : arr[] =… Read More »

The problem is to convert the given binary number (represented as string) to its equivalent octal number. The input could be very large and may… Read More »

Given two numbers m and n. Find the position of rightmost different bit in binary representation of numbers. It is guaranteed that such a bit… Read More »

The problem is to check whether the decimal representation of the given binary number is divisible by 5 or not. Take care, the number could… Read More »

The problem is to convert the given binary number to its equivalent hexadecimal number. The input could be very large and may not fit even… Read More »