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 you guys think about Discussion Introductions?
In a free enterprise system, governments address public problems through policy to ensure that A.citizens' needs are met and protected B.economic operations of
Write the next three terms of the following sequence: 160, 136, 112, 88, ... Explain your reasoning or the pattern you found:
(8.03 LC) A set of equations is given below: Equation C: y = 4x + 8 Equation D: y = 4x + 2 Which of the following best describes the solution to the given set o
The quotient of x and 2. Like is it times? kinda like 6 more than x is 6 + x I just need it out in numbers and stuff
GEOMETRY QUESTION Please help, I'm so bad at Geometry all help is appreciated.
Broccoli, cauliflower, kale, and cabbage all originated from the wild mustard plant, but farmers artificially selected these distinct crops over time. Artificia
3/4h-9=1/4h-1 i need help
what is the genral form of (x-6)2+(y-4)2=56
what is a cattle drive (5th grade) answer I'm in 5th plz tell me