Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that takes in an integer in the range 20-98 as input. The output is a countdown starting from the integer, and stopping

Write a program that takes in an integer in the range 20-98 as input. The output is a countdown starting from the integer, and stopping when both output digits are identical.

Ex: If the input is 93, the output is:

93 92 91 90 89 88 

Ex: If the input is 77, the output is:

77 

Ex: If the input is not between 20 and 98 (inclusive), the output is:

Input must be 20-98 

For coding simplicity, follow each output number by a space, even the last one. Use a while loop. Compare the digits; do not write a large if-else for all possible same-digit numbers (11, 22, 33, ..., 88), as that approach would be cumbersome for large ranges.

Must be in CORAL CODING, appropriate spaces no one has been able to help me

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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions

Question

1 The elements of the modern macroeconomic consensus

Answered: 1 week ago

Question

What was new York's original name?

Answered: 1 week ago

Question

In 2004 what base ball team ended an 85 year championship drought?

Answered: 1 week ago

Question

On what date was the declaration of independence signed?

Answered: 1 week ago

Question

What achievement is Amelia ear heart best known for?

Answered: 1 week ago