You are on page 1of 1

Qu Write a program to enter 100 digits only and then output number of each digit entered.

The user is
asked to reenter if it is not a digit.
digitcounter(0) Number of digit Zeroes entered
Dim digit as integer digitcounter(1) Number of digit ones entered
Dim digitcounter(10) as integer digitcounter(2) Number of digit twos entered
Dim i as integer

For i = 1 to 10
Digitcounter(i) = 0
Next

For i = 1 to 100
DO
Console.writeline(“enter a digit”)
Digit = Console.readline
IF NOT (digit>= 0 and digit <= 9) then
Console.writeline (“ERROR! Please enter a digit”)
Endif
LOOP Until (digit>= 0 and digit <= 9)

Digitcounter(Digit) = digitcounter(Digit) + 1

Next

For i = 0 to 9
Console.writeline (“The number of ” & i & “ is ” & Digitcounter(i))
Next

Console.Readkey

You might also like