C program to covert binary to decimal number

Problem statement

Write a problem which takes a binary number from the user and convert them into a decimal number.

What is binary number and decimal number?

A binary number is consist of only 0’s and 1’s.
We can represent any number into the binary form.
Each digit is referred to as a bit.

Numbers from 2 to 9 are called as decimal numbers.
For example:

Decimal number Binary number
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001

In this way, we can convert any number into the binary number.

Program for converting binary to decimal.

Output:

Help others by sharing the content!

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.