[46575 views]

A number system with a base 10 is known as decimal number system. Hence, decimal numbers are denoted with a base 10.

This number system consists of 10 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. Each digit in the decimal system has a position and every digit is ten times more significant than the previous digit.

For example: (461)_{10} , (370)_{10} , (890)_{10} , (400)_{10} , etc.

A number system with a base 2 is known as binary number system. Hence, binary numbers are denoted with a base 2. It consists of two values: 0 and 1.

Each digit in this system is said to be a bit. For example: (110101)_{2}, (10101101)_{2}, (10000)_{2}, (10)_{2}, etc.

We will start off by taking the number to be converted as user input. The idea behind this conversion is to extract the last digit from the number one at a time and multiply it with 2 to the power of the number’s position. This process is repeated for all the digits of the number. After this, all these products are added and the final sum is the corresponding decimal number. Let us take a look at an example for better understanding:

Given binary number: (10110)_{2}

Corresponding decimal number = (1*2^{4}) + (0*2^{3}) + (1*2^{2}) + (1*2^{1}) + (0*2^{0})

= 16 + 0 + 4 + 2 + 0

= 22

- Algorithm and Flowchart for Tower of Hanoi
- Algorithm and Flowchart to Find transpose of a matrix
- Pseudocode and Flowchart for finding the largest element in an Array
- Algorithm and flowchart to check two numbers are Amicable number or not
- Algorithm and flowchart to find Frequency of Characters in Sentence

- Algorithm and Flowchart to find if a Number is Even or Odd
- Algorithm and Flowchart to find whether a number is Prime Number or Not
- Algorithm and Flowchart for Armstrong Number
- Algorithm for Finding Factorial of a Number
- Algorithm and Flowchart to Calculate Fibonacci series up to n
- How to round a number to nearest integer using python
- Can we have DB table without a primary key?
- Why does everyone hate Java?
- How much JavaScript to learn for Web Development
- How to store password like sensitive information in application