C Program to convert decimal number to Binary, Octal or Hexadecimal

By | March 22, 2017

C Program to convert decimal number to Binary, Octal or Hexadecimal


Write a C Program to convert positive decimal number to Binary, Octal or Hexadecimal. Here’s a Simple Program to convert decimal number to Binary, Octal or Hexadecimal number in C Programming Language.

Create a program that would convert a decimal number to binary, octal or hexadecimal counterpart. Your program should ask the user for decimal with a data type of a long integer.


Decimal system : :


  • Decimal system is the most widely used number system. But computer only understands binary. Binary, octal and hexadecimal number systems are closely related and we may require to convert decimal into these systems.
  • Decimal system is base 10 (ten symbols, 0-9, are used to represent a number) and similarly, binary is base 2, octal is base 8 and hexadecimal is base 16.

Below is the source code for C Program to convert positive decimal number to Binary, Octal or Hexadecimal which is successfully compiled and run on Windows System to produce desired output as shown below :


SOURCE CODE : :



OUTPUT  : :



If you found any error or any queries related to the above program or any questions or reviews , you wanna to ask from us ,you may Contact Us through our contact Page or you can also comment below in the comment section.We will try our best to reach upto you in the short interval.


Thanks for reading the post….

Leave a Reply