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
Tag Archives: binary-representation
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 an 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[] =… 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
Given a real number between 0 and 1 (e.g., 0.72) that is passed in as a double, print the binary representation. If the number cannot… Read More
Given a binary input that represents binary representation of positive number n, find a binary representation of n+1.The binary input may be and may not… Read More
Given an string of binary number n. Convert binary fractional n into it’s decimal equivalent. Examples: Input: n = 110.101 Output: 6.625 Input: n =… Read More
Given a fraction decimal number n and integer k, convert decimal number n into equivalent binary number up-to k precision after decimal point. Examples: Input:… Read More