0

how can I separate the characters of a number by taking each number singularly? I have the number 842 and i need to separate it into 8, 4, 2.

1 Answers1

0
  • Take the input as a string
  • Iterate over it character by character until the end of the string (the null terminator).
  • Convert each digit from ASCII to integer by subtracting the value '0' from it.
Lundin
  • 195,001
  • 40
  • 254
  • 396