โ Back to Loops
Question 290
Count Digits in a Number (while)
Count Digits in a Number (while)
The variablenholds the value4587. Use awhileloop to count how many digits it has, then print: Digits: 4 Repeatedly dividenby10and count each step untilnbecomes0.
Expected Output:
Digits: 4
Topics:
Loops
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (sysout, psvm, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.