loveefya1890 loveefya1890
  • 26-05-2022
  • Computers and Technology
contestada

write a program using a for loop, to display number 20 to 10 in descending order

Respuesta :

rvkacademic
rvkacademic rvkacademic
  • 30-05-2022

Answer:

public class MyProgram {

  public static void main(String[] args) {

     for (int i = 20; i >= 10; i--){

        System.out.println(i);

     }

  }

}

Explanation:

Since we are printing in descending order, we start with an initial value of 20, keep decrementing counter by 1 (the i-- part) until i reaches 20

Answer Link

Otras preguntas

The largest moth is the Atlas moth. The Atlas moth is 11.8 inches long Which of the following is the lenghth of the Atlas moth written as a mixed number
Need help due tommorow be creative pls my wifi sucks
Describe why Suzan Shown Harjo is offended by the term “redskin."
The value of 5x2 - 11x + 18 is when x = 2.4 and whenx = -3.
An eccentric emu runs 20 m/s for 5 minutes for the first part of his trip to Hollywood. Once tired, the emu runs slower speed for the next hour. The average vel
The zoo in Samir's city is building a new habitat for its 7 spider monkeys. The habitat will have trees, ladders, and vines in a cube-shaped cage that measures
How does inflation affect standard of living?
I WILL MARK AS BRAINLIEST! Find the surface area and Volume of the following figures
You are graphing rectangle ABCD in the coordinate plane. The following are three of the vertices of the rectangle: A(3,5), B(3,-4), and C(-2,-4). What are the c
What's the difference between a hypothesis and a theory?