#Python program to convert decimal number into binary, octal and hexadecimal number system
# Change this line for a different result
dec = 344
print("The decimal value of",dec,"is:")
print(bin(dec),"in binary.")
print(oct(dec),"in octal.")
print(hex(dec),"in hexadecimal.")
# Change this line for a different result
dec = 344
print("The decimal value of",dec,"is:")
print(bin(dec),"in binary.")
print(oct(dec),"in octal.")
print(hex(dec),"in hexadecimal.")
Output:
The decimal value of 344 is:
0b101011000 in binary.
0o530 in octal.
0x158 in hexadecimal.
0b101011000 in binary.
0o530 in octal.
0x158 in hexadecimal.
0 Comments:
Post a Comment