Programming Examples

Python program to convert decimal into other number systems


Python program to convert decimal into other number systems

Solution

num = int(input("Enter any Decimal Number : "))
print("The decimal value of", num, "is:")
print(bin(num), "in binary.")
print(oct(num), "in octal.")
print(hex(num), "in hexadecimal.")
Output

Enter any Decimal Number : 25

The decimal value of 25 is:

0b11001 in binary.

0o31 in octal.

0x19 in hexadecimal.

Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2026 Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Best Website and Software Company in Allahabad