Given a number N, the task is to write C program to count the number of 0s and 1s in the binary representation of N....
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 may not fit even into an unsigned long long int....
Given a binary matrix of size M*N containing only 0 and 1. The task is to count the number of mappings in the matrix. There is one mapping between any two 1s if the following conditions are satisfied:...
Given an array arr[] consisting of N positive integers, the task is to find the maximum absolute difference between the sum of the array elements placed at even indices and those at odd indices of the array by rotating their binary representations any number of times. Consider only 8-bit representation....
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 be very large and may not fit even in long long int. The approach should be such that there are zero or minimum number of multiplication and division operations. No leading 0’s are there in the input.Examples:...
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 not fit even into unsigned long long int....
Given a binary array arr[] of size N and some queries. Each query represents an index range [l, r]. The task is to find the xor of the elements in the given index range for each query i.e. arr[l] ^ arr[l + 1] ^ … ^ arr[r]....
Given a binary array and Q queries. Every query consists of a number K, the task is to print the number of ones and zeros to the left of the index K. Examples:...
Given four integers N, M, A, B where N is the number of rows and M is the number of columns, the task is to check if is possible to create a binary matrix of dimensions N x M such that every row has A number of 1s and every column has a B number of 1s. If any such matrix is possible then print it else print “-1”....
Given an array A[] of size N with entries as integers, some of the entries are -1. The task is to replace -1’s with numbers satisfying the below criteria....
Given a fraction decimal number n and integer k, convert decimal number n into equivalent binary number up-to k precision after decimal point....