how to write a loop count in the format do while loop from 1-20 in even numbers
Added by Clara M.
Step 1
Sure! Here’s how to write a `do while` loop that counts even numbers from 1 to 20 step by step. Show more…
Show all steps
Your feedback will help us improve your experience
Sri K and 99 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Write a Java while loop that displays the first five (5) even numbers.
Sri K.
Debolina B.
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.CORAL CODING
Cora M.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD