Python program to convert decimal to binary octal and hexadecimal using function

0
10
def dec_to_binary(dec):  # Function which is convert decimal to binary
    decimal = int(dec)
    print(decimal, " in Binary : ", bin(decimal)) 
def dec_to_octal(dec):   # Function which is convert decimal to octal
    decimal = int(dec)
    print(decimal, "in Octal : ", oct(decimal))  
def dec_to_hexa(dec):  # Function which is convert decimal to hexadecimal
    decimal = int(dec)
    print(decimal, " in Hexadecimal : ", hex(decimal)) 
#____main____
d=int(input("Please enter a decimal number: ")) # d represents decimal number
dec_to_binary(d)
dec_to_octal(d)
dec_to_hexa(d)

   Output 1:
           Please enter a decimal number: 33
           33  in Binary :  0b100001
           33 in Octal :  0o41
           33  in Hexadecimal :  0x21
   Output 2:
           Please enter a decimal number: 62
           62  in Binary :  0b111110
           62 in Octal :  0o76
           62  in Hexadecimal :  0x3e

इन्हें भी देखें।

Python Programs के लिये यहाँ click करें।

 

 

 

 

Python program to convert decimal to binary octal and hexadecimal using function Python program to convert decimal to binary octal and hexadecimal program to convert decimal to binary octal and hexadecimal in python write a program to convert decimal to binary octal and hexadecimal write a program to convert decimal to binary octal and hexadecimal in python write a python program to convert decimal to binary octal and hexadecimal program to convert decimal to binary octal and hexadecimal convert decimal to binary octal and hexadecimal using function program to convert decimal to binary octal and hexadecimal using function program to convert decimal to binary octal and hexadecimal using function in python write a program to convert decimal to binary octal and hexadecimal using function in python write a python program to convert decimal to binary octal and hexadecimal using function python program to convert decimal to binary octal and hexadecimal program to convert decimal number to binary octal and hexadecimal in python python program to convert decimal to binary octal and hexadecimal using function write a program to convert decimal to binary decimal to octal and decimal to hexadecimal in python write a python program to convert the given decimal number to binary octal and hexadecimal python program to accept a decimal number and convert it to binary octal and hexadecimal number python program to convert decimal into binary octal and hexadecimal python program to convert decimal number to binary octal and hexadecimal python program to convert the given decimal number to binary octal and hexadecimal python program for conversion of decimal to binary octal hexadecimal how to convert decimal to binary octal and hexadecimal how to convert decimal to binary octal and hexadecimal in python how to convert decimal to binary octal and hexadecimal using function in python how to convert decimal into binary octal and hexadecimal converting decimal to binary octal and hexadecimal how to convert decimal number to binary octal and hexadecimal convert decimal to binary octal and hexadecimal

LEAVE A REPLY

Please enter your comment!
Please enter your name here