Given a range [L, R]. The task is to find the total number of Hexadecimal alphabets that are required to write every number in the… Read More »

## Recursive Program for Binary to Decimal

Given a binary number as string, find its decimal equivalent. Examples: Input : binary = “101” Output : 5 Input : binary = “1111” Output… Read More »

## Python program to convert decimal to binary number

Given a decimal number as input, the task is to write a Python program to convert the given decimal number into equivalent binary number. Examples… Read More »

## Sum of the digits of a number N written in all bases from 2 to N/2

Given an integer N, the task is to find the sum of the digits of the number N written in all the bases from 2… Read More »

## Check whether a number has consecutive 0’s in the given base or not

Given a decimal number N, the task is to check if a number has consecutive zeroes or not after converting the number to its K-based… Read More »

## Program to Convert Hexadecimal to Octal

Given a Hexadecimal number, the task is to convert it into an Octal number. Examples: Input: Hexadecimal = 1AC Output: Binary = 0654 Explanation: Equivalent… Read More »

## Program to Convert Octal Number to Binary Number

Given an Octal number as input, the task is to convert that number to Binary number. Examples: Input : Octal = 345 Output : Binary… Read More »

## Complement of a number with any base b

One’s Complement of an Integer 1’s and 2’s complement of a Binary Number In this post, a general method of finding complement with any arbitrary… Read More »

## Check if Decimal representation of an Octal number is divisible by 7

Given an Octal number N. The task is to write a program to check if the Decimal representation of the given octal number N is… Read More »

## Check if a number is in given base or not

Given a number as string and a base, check if given number is in given base or not. Examples: Input : str = “1010”, base… Read More »

## Convert Hexadecimal value String to ASCII value String

Given Hexadecimal value string as input, the task is to convert the given hexadecimal value string into their corresponding ASCII format string. Examples: Input: 6765656b73… Read More »

## Previous number same as 1’s complement

Given a number check whether binary representation of its predecessor and its 1’s complement are same or not. Examples: Input : 14 Output : NO… Read More »

## Sum of digits written in different bases from 2 to n-1

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 program to convert floating to binary

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 »

## Decimal Equivalent of Gray Code and its Inverse

Given a decimal number n. Find the gray code of this number in decimal form. Examples : Input : 7 Output : 4 Explanation: 7… Read More »