Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that reads a positive integer less than 1000 and prints how many digits the number has, by checking whether the number is

Write a program that reads a positive integer less than 1000 and prints how many digits the number has, by checking whether the number is 10, 100. The program will run continuously in a loop, checking with the user if he/she wants to try again. If the answer is yes the program will run again, asking the user to enter a number. If the answer is no, the loop will stop.

Example of output:

Enter a number: 125

Three digits

Do you want to try again? yes

Enter a number: 24

Two digits.

Do you want to try again? yes

Enter a number: 3

One digit.

Do you want to try again? no

Bye!

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

=+3. What is its quality?

Answered: 1 week ago

Question

a neglect of quality in relationship to international competitors;

Answered: 1 week ago