Loops Problems

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10

Problem Solving with Loops

In this problem, the program should calculate the number of digits in a given positive integer, in this case, 1240791. You can count the number of digits, 7, but your job is to make a program that can count the number of digits of any given positive integer.

Most of the program has been written for you, but it still needs a repeat while or repeat until block with a boolean expression. Add a repeat block and add the boolean expression that will produce the following output.

124079
12407
1240
124
12
1
0
The number of digits in the original integer is 7

Coding:

Blocks

PreviousNext