Friday, February 1, 2019

Conversion

  • Problem Description

    Chris was given a task by his friend rajesh. When rajesh tells a number then chris needs to convey the value in binary, octal, hexadecimal for the decimal equivalent value told by his friend rajesh. 

    Help them to achieve this task
  • CODING ARENA
  • dec=int(input())
    print("The Binary Value",bin(dec))
    print("The octal Value",oct(dec))
    print("The hexadecimal Value",hex(dec))
  • Test Case 1

    Input (stdin)
    344
    
    
    Expected Output
    The Binary Value 0b101011000
    
    The octal Value 0o530
    
    The hexadecimal Value 0x158
  • Test Case 2

    Input (stdin)
    25
    
    
    Expected Output
    The Binary Value 0b11001
    
    The octal Value 0o31
    
    The hexadecimal Value 0x19

No comments:

Post a Comment