How Many Digits?

Published by medyah99 in

Given an integer n. Your task is to find how many digits this integer contains without using String or Array methods!

Examples

sumDigits(100) ➞ 3

sumDigits(1000) ➞ 4

sumDigits(1) ➞ 1

Notes

N/A

Watch a quick demo on how Edabit works.