Skip to content

Tag Archives: base-conversion

Given the Hexadecimal value string as input, the task is to convert the given hexadecimal value string into their corresponding ASCII format string. Examples:  Input:… Read More
Given a number check whether binary representation of its predecessor and its 1’s complement are same or not. Examples:  Input : 14 Output : NO Storing 14 as… Read More
Given a number n, find the sum of digits of n when represented in different bases from 2 to n-1.Examples:   Input : 5 Output :… Read More
Python doesn’t provide any inbuilt method to easily convert floating point decimal numbers to binary number. So, Let’s do this manually. Approach : To convert… Read More
Given a decimal number n. Find the gray code of this number in decimal form. Examples:  Input : 7 Output : 4 Explanation: 7 is represented as… Read More
The problem is to check whether the decimal representation of the given binary number is divisible by 20 or not. Take care, the number could… Read More
Stringstream is stream class present in C++ which is used for doing operations on a string. It can be used for formatting/parsing/converting a string to… Read More
Given a positive integer number n generate all the binary number from 0 to n. Examples: Input : 5 Output : 0 1 10 11… Read More
Given two numbers you are required to check whether they are anagrams of each other or not in binary representation. Examples: Input : a =… 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 an integer ‘n’, write a Python function that returns true if binary representation of x is palindrome else return false. Examples: Input : n… Read More
Given an positive integer and size of bits, reverse all bits of it and return the number with reversed bits.Examples: Input : n = 1,… Read More
Given a decimal number n without floating-point. The problem is to convert the decimal number to octal number with minimum use of arithmetic operators.  Examples: … Read More
Double base Palindrome as the name suggest is a number which is Palindrome in 2 bases. One of the base is 10 i.e. decimal and… Read More
Python bin() function returns the binary string of a given integer. Syntax:  bin(a) Parameters : a : an integer to convert Return Value : A… Read More

Start Your Coding Journey Now!