# Tag Archives: base-conversion

## Python | Check if binary representation is palindrome

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 »

## Reverse bits of a positive integer number in Python

Given an positive integer and size of bits, reverse all bits of it and return the number with reversed bits. Examples: Input : n =… Read More »

## Decimal to octal conversion with minimum use of arithmetic operators

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.… Read More »

## Double Base Palindrome

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 »

## bin() in Python

Converting an decimal to binary is always an important utility that is required in python dev projects and competitive programming as well. Having a shorthand… Read More »

## Check if a number is power of k using base changing method

This program checks whether a number n can be expressed as power of k and if yes, then to what power should k be raised… Read More »

## Decimal representation of given binary string is divisible by 10 or not

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 »

## Decimal to binary conversion without using arithmetic operators

Find the binary equivalent of the given non-negative number n without using arithmetic operators. Examples: Input : n = 10 Output : 1010 Input :… Read More »

## Binary to decimal and vice-versa in python

Write Python code for converting a decimal number to it’s binary equivalent and vice-versa. Example From decimal to binary Input : 8 Output : 1… Read More »

## Convert all substrings of length ‘k’ from base ‘b’ to decimal

A string defining a valid number is given. Output all the base conversions of substrings of length ‘k’ from base ‘b’ to base 10. Examples:… Read More »

## Program for hexadecimal to decimal

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

## Program for octal to decimal conversion

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

## Program for decimal to octal conversion

Given a decimal number as input, we need to write a program to convert the given decimal number into equivalent octal number. i.e convert the… Read More »

## Program for Decimal to Binary Conversion

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 »

## Program for Binary To Decimal Conversion

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 »