High School

Write a program that prints out the numbers from 20 to 0, decreasing by 2 each time. After counting down to zero, print "Done!".

The output of your program should be:

20
18
16
14
12
10
8
6
4
2
0
Done!

Answer :

Final answer:

The question asks for a program that counts down from 20 to 0, reducing by 2 each step. An example program is provided in Python, using the range function with appropriate start, end, and step parameters. After the countdown, the program prints 'Done!'.

Explanation:

The program you're asking for is a simple task in most programming languages. Here, I'll provide an example in Python:

for i in range(20, -1, -2):
print(i)
print('Done!')

This program starts with the number 20 (the start of the range), then counts down to -1 (just below zero, because the end of range is exclusive), and reduces the current count by 2 each time (which is the step parameter of the range function). After the loop finishes, it will print 'Done!' as requested.

Learn more about Python Program here:

https://brainly.com/question/32674011

#SPJ11

Final answer:

To write a program that prints out the numbers from 20 to 0, decreasing by 2 each time, you can use a loop. Here's an example of how the code would look like in Python:

Explanation:

Here is a Python program that prints out the numbers from 20 to 0, decrease by 2 each time and prints "Done!" at the end:for i in range(20, -2, -2): print(i)print("Done!")- We use a for loop to iterate over the range from 20 to -2 with a step of -2. The `range()` function in Python generates a sequence of numbers, and we can specify the start, stop, and step for the sequence. In this case, we start at 20, stop at -2 (which is not included in the sequence), and decrement the value by 2 each time until we get to 0.- Inside the loop, we print the value of `i` using the `print()` function.- After the loop, we print "Done!" using the `print()` function. This will be executed once the loop has finished counting down from 20 to 0.The output of the program is:20181614121086420Done!

Learn more about Python

brainly.com/question/30391554

#SPJ11