CJCoding With Joseph

While Loop: Count the Digits

A positive integer is given. Use a while loop to count how many digits it has, and print the count.

For 12345 the program prints 5.

Expected Output:

5
Topics:
Loops
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (clog, fn, fori)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.