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

what is .54 repeating as a fraction
the total length of 4 blue banners and 5 yellow banners is 49 meters. the total length of 2 blue banners and 1 yellow banner is 17 meters all banners of the sa
the total length of 4 blue banners and 5 yellow banners is 49 meters. the total length of 2 blue banners and 1 yellow banner is 17 meters all banners of the sa
The temperature danger zone is:*
15=7-|2x| Solve for x in this absolute value equation.
n what way did the Christian Crusades contribute to the decline of the Byzantine Empire ?
The temperature danger zone is:*
graph this equation 3x+4y=12
determine the part of speech in the sentence: at what time did you stop by?
Need help to Write 4.01 as a percent