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

simplify: (6x-4) (9x-2)
digesting a candy bar is a physical change or chemical change? why?​
One country has 12 stone bridges and 20 steel bridges. What is the ratio of ? A. Stone bridges to steel bridges. B. Steel bridges to stone bridges. C total brid
the red badge of courage chapter 6-7 who is the monster
Why did the Europeans want steel?
Is it true that the U.S. needs to eliminate its national debt?​
How does the author choose to give exposition about the characters? How does this choice contribute to the meaning of the story?
PLEASE HELP IMMEDIATELY!!! 5x + 11 = 4x + 18 and describe the steps!!!
Which of the following best defines a band of American Indians? a large group with a chief a close, extended family a tribe with many villages a federation with
what occurred in December 07, 1941