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 the result when the number 6 is increased by 50%?
The idea of laissez-faire, or how much the government should do, is DO NEV not debated at all debated heavily Intro 20 of 20
Help me please i need the answer
Who were some of the primary artists Atlantic Records recorded 
how can people create beautiful art.
Which statement best describes how citizenship differed between Sparta and Athens? In Athens, citizens were free men, while in Sparta, citizenship was granted t
what is 16.350 eastimed to nearest 100​
two more than4 times a number is -18
If a shape has 4 right angles, then it is a rectangle. What is the converse of the statement? If a shape does not have 4 right angles, then it is not a rectangl
Which of the following DOES NOT belong in a summary of "The Fox and The Horse"? (RL2) * (10 Points) The old horse is sent away by his owner. The horse receives