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

A ladder leans against the side of a house. The top of the ladder is 2 m from the ground. The bottom of the ladder is 2 m from the side of the house. Find the l
find the missing length
Write as product 8x^3-1
A 3 kg model airplane is traveling at a speed of 33 m/s. The operator then increases the speed up to 45 m/s in 2 seconds. How much force did the engine need in
what's the value of x 4x+10=-26
Please help!!!!!! thank you so much
Which line from Act II of The Importance of Being Earnest is a paradox? “Child, you know how anxious your guardian is that you should improve yourself in every
If a car goes 50 miles per hour, how many minutes will it take for the car to go 10 miles
what process should be carried out during fractional distillation of crude oil to maximize the output of petrol or gasoline?​
this was answered, sorry.