93. Print Binary Representation of an 8-bit or 16-bit Value

In embedded development, visualizing the binary form of a value is crucial for debugging and understanding register configuration. Your task is to:

  • Read an unsigned integer (8-bit or 16-bit)
  • Print its binary representation, padded with leading zeros
  • Length must be 8 bits (if input ≤ 255) or 16 bits otherwise 


Example-1

Input: val = 10
Output: 00001010


Example-2

Input: val = 255
Output: 11111111


Example-3

Input: val = 1023
Output: 0000001111111111


Example-4

Input: val = 65535
Output: 1111111111111111


 

Loading...

Input

10

Expected Output

00001010