By: Prem Tiwari | Last Updated:
In this tutorial, we will explain a simple program to convert the decimal number into binary number. We have not used any number validation in this program as it is designed for the beginners for learning purpose.
You can modify this program to validate the number entered by the user during the program execution, then user can only enter the decimal number as input.
Copy below c program and execute it with c complier to see the output of the program and also start converting the number system from decimal to binary number.
void dec_bin(long int num)
long int rem,i=0,length=0;
printf("nBinary number : ");
long int num;
printf("Please enter the decimal number: ");
Please enter the decimal number: 80
Decimal number : 1010000
Prem Tiwari is the founder of freewebmentor.com and is a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby and also he has been a regular speaker of WordPress sessions in various IT Companies.View all posts by Prem Tiwari
Tags: convert decimal numbers to binary, convert decimal to binary number, converting decimal numbers to binary, decimal to binary number converter, how to convert decimal numbers to binary, how to convert decimals to binary, how to convert to decimal to binary