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

help friends please :(
A cell phone plan charges a $40 base fee. If the total cost of talking 20 minutes is $41, what is the rate of change of the cost per minute talked?
Which of the following statements most likely explains the increase in crime rates during the Depression era? A.Crime rates increased during the Depression bec
According to fox and levin's typology of mass murder, the most common type of mass murderer is the ____________ murderer.
Danitza would have bouts of depression followed by periods of normalcy. on her last admission, she presented with increased excitability, euphoric mood, and rap
find the sum of the series: .25+.125+.0625+....
General George Patton famously led Allied troops during which event?
What is the value of -3r+8 when r=4?
At the beginning of a meal, the hormone _______ is secreted from the stomach; this hormone controls the release of _______.
Question in the picture A. 0.00006 B. 0.0006 C. 6.00 D. 6. E. None of the above