## StringStream in C++ for Decimal to Hexadecimal and back

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 »

## Generate all the binary number from 0 to n

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 »

## Python Dictionary | Check if binary representations of two numbers are anagram

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 »

## Decimal to binary number using recursion

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 »

## 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 »