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

in The Censors, Juans actions and motivations change from...1. fearful to determine2. love struck to scheming3. selfless to self absorbed4. single minded to wea
what is the definition of ppos in health
julia spends 2.25 on gas for her lawn mower.she earns 15.00 mowing her neighbors yard.what is julias profit?
One of the most important legacies of the Northwest Ordinance was that it prevented the expansion of ________________ north of the Ohio River in the new territo
what is the answer to 7 x 9
What is the distance around the world on the equator? in miles?
The United States invaded Iraq in 1991 and 2003. What was different about these invasions? In 1991 the goal was to end the takeover of Kuwait, while in 2003 it
how does sergei react when yoni comes to the door in what, of this goldfish, would you wish?
the length of a rectangular label is 2.5 cm less than twice the width. the perimeter is 40.6 cm. find the width.
11 more than 5 of a certain number is twenty more than 2 times of that number. What is the number?