#include<stdio.h>

int main(){

long int binaryNumber,decimalNumber=0,j=1,remainder;

printf(“Enter any number any binary number: “);

scanf(“%ld”,&binaryNumber);

while(binaryNumber!=0){

remainder=binaryNumber%10;

decimalNumber=decimalNumber+remainder*j;

j=j*2;

binaryNumber=binaryNumber/10;

}

printf(“Equivalent decimal value: %ld”,decimalNumber);

return 0;

}

**Sample output:**

Enter any number any binary number: 1101

Equivalent decimal value: 13

**Algorithm:**

**Binary number system:** It is base 2 number system which uses the digits from 0 and 1.

**Decimal number system:**

It is base 10 number system which uses the digits from 0 to 9

**Convert from binary to decimal algorithm:**

For this we multiply each digit separately from right side by 1, 2, 4, 8, 16 … respectively then add them.

**Binary number to decimal conversion with example:**

For example we want to convert binary number 101111 to decimal:

Step1: 1 * 1 = 1

Step2: 1 * 2 = 2

Step3: 1 * 4 = 4

Step4: 1 * 8 = 8

Step5: 0 * 16 = 0

Step6: 1 * 32 = 32

Its decimal value: 1 + 2 + 4+ 8+ 0+ 32 = 47

That is (101111)_{2} = (47)_{10}

That is the proper weblog for anyone who wants to search out out about this topic. You realize so much its virtually exhausting to argue with you (not that I actually would want…HaHa). You undoubtedly put a brand new spin on a subject thats been written about for years. Great stuff, simply great!

Hiya, I’m really glad I’ve found this information. Nowadays bloggers publish only about gossips and web and this is really frustrating. A good website with exciting content, that is what I need. Thanks for keeping this web-site, I will be visiting it. Do you do newsletters? Can not find it.

Thankyou . Please subscribe you with my site

Howdy very cool site!! Man .. Beautiful .. Amazing .. I will bookmark your website and take the feeds additionally¡KI am happy to search out numerous helpful info here within the put up, we want work out extra techniques in this regard, thanks for sharing. . . . . .

Thankyou for ur appreciation and keep in touch with website

I have recently started a web site, the info you provide on this web site has helped me greatly. Thanks for all of your time & work.

Hey There. I found your blog using msn. This is an extremely well written article. I’ll be sure to bookmark it and come back to read more of your useful information. Thanks for the post. I will definitely comeback.

you’re in reality a just right webmaster. The web site loading velocity is incredible. It kind of feels that you are doing any distinctive trick. Furthermore, The contents are masterpiece. you have performed a excellent job in this matter!

Good post. I learn something new and challenging on sites I stumbleupon every day. It will always be exciting to read through articles from other authors and use something from their sites. |

hey there and thank you for your info – I’ve certainly picked up something new from right here. I did however expertise a few technical points using this site, as I experienced to reload the website many times previous to I could get it to load correctly. I had been wondering if your web host is OK? Not that I’m complaining, but slow loading instances times will very frequently affect your placement in google and can damage your high-quality score if ads and marketing with Adwords. Well I’m adding this RSS to my email and could look out for a lot more of your respective fascinating content. Ensure that you update this again very soon..