Menu Close

How to Convert Decimal to Hexadecimal?

Posted in C Programming, C++ Programming, Computer Science, Digital Circuit

Method 1. It is easy to convert Decimal to Hexademical :

Method 2. How to Convert a Decimal Number to Hexadecimal

Let’s say we want to convert the decimal number 482 to hexadecimal.

Step 1: Divide the decimal number by 16.

482 / 16 = 30 remainder 2

Step 2: Convert the remainder (2) to its corresponding hexadecimal digit.

Remainder 2 corresponds to the hexadecimal digit “2”.

Step 3: Divide the quotient (30) by 16.

30 / 16 = 1 remainder 14

Step 4: Convert the remainder (14) to its corresponding hexadecimal digit.

Remainder 14 corresponds to the hexadecimal digit “E”.

Step 5: Continue the process until the quotient is 0.

1 / 16 = 0 remainder 1 Remainder 1 corresponds to the hexadecimal digit “1”.

Step 6: Write the hexadecimal digits in reverse order.

The hexadecimal equivalent of decimal 482 is 1E2.

Therefore, decimal 482 in hexadecimal is represented as 1E2.

 

Related:   Conversion Between Decimal and Binary

Leave a Reply