suzen123
suzen123 suzen123
  • 04-01-2021
  • Computers and Technology
contestada

JAVA

Write a program to display the given pattern:
3
5 6
8 9 10
12 13 14 15​

Respuesta :

tonb
tonb tonb
  • 04-01-2021

Answer:

class Main {  

 public static void main(String args[]) {

   int nr = 1;

   int value = 3;

   while(value < 16) {

      for(int i=0; i<nr; i++) {

          System.out.printf("%d ",value++);

      }

      System.out.println();

      value++;

      nr++;

   }

 }

}

Explanation:

This is one of the many approaches...

Answer Link

Otras preguntas

can i get some help i dont get it
a process that modifies light waves so they vibrate in a single plane is referred to as
two-year-old sara lives in a home where the family has a german shepherd. sara knows the word doggie. one day, when sara is outside with her mother, she sees a
the original price of a mountain bike was reduced by $125.the new discounted price is $479
in 1 or 2 sentences, explain the effect of a price floor on the quantity of a good.
how does the concept of competition relate to the arms race between the united states and the soviet union during the cold war?
Wireless internet is an example of telecommunications.
what factor is not a part of the highway traffic system? a. the environment b. highways c. drivers d. car washes
By default the Windows desktop displays programs, task bar and gadgets. T/F
what is dog in spanish