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 social studies what is a profit
When India began its population policies in 1951, the government focused on __________. A.economics B.gender equality C.forced population control D.family plann
Tecumseh's "Let the white race perish" speech is
what two culture blended to shape the development of the maxico
when congress doesnt approve a presidents choice for a federal court this is an example of
The information revolution of the 20th century was a result of A. The invention of the artificial satellite B. A rise in the standard of living C. The inventi
What is found in the air spaces within soil?
A similarity between the separation of powers, the system of checks and balances, and federalism is that they
Words that end in -ous are _____. A. nouns B. adverbs C. adjectives D. verbs
I don't know how to work out the equation below 3(x+4)=27 Can someone show me how it's done please