Skip to content

# Tag Archives: binary-representation

Given Binary code of a number as a decimal number, we need to convert this into its equivalent Gray Code. Examples :   Input : 1001 Output… 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 the prime number of set bits… 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 their 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 an equivalent decimal number. Examples : … 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[] = {1,… 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 the rightmost different bit in the binary representation of numbers. It is guaranteed that such… 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
Given a Binary Number, the task is to convert the given binary number to its equivalent hexadecimal number. The input could be very large and… Read More