96. Convert Integer to String

In embedded systems, numeric values often need to be converted into printable string format (e.g., for UART or display output), but you may not have access to standard C library functions like itoa() or sprintf().

Your task is to:

  • Read a signed integer
  • Convert it to its string representation and
  • Print each character with a space between characters
  • Do not use itoa(), sprintf() or string libraries
     

Example-1

Input: 123
Output: 1 2 3


Example-2

Input: -45
Output: - 4 5


Example-3

Input: 0
Output: 0


 

Need Help? Refer to the Quick Guide below
Loading...

Input

123

Expected Output

1 2 3