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

solve 2/3 + 1/4x = 1/3
The circumference of a circle is 6.28.What is the area of the circle?
The process by which rocks are broken down into smaller fragments by the atmosphere and other factors in the environment is called?
Two 1 litre jugs are each filled with a mixture of olive oil and vinegar. The first jug has 3 times as much as oil as vinegar and the second jug has 4 times as
If 2 less than or equal too X less than or equal too 6, which of the following has the greatest value
Two 1 litre jugs are each filled with a mixture of olive oil and vinegar. The first jug has 3 times as much as oil as vinegar and the second jug has 4 times as
How do u write 6 more the 7 times a number is 41 in algebraic equation??
16 increased by twice a number is -24. Find the solution??
16 increased by twice a number is -24. Find the solution??
The dimensions of a brick that weighs 25 N are 0.19 m × 0.07 m × 0.095 m. What pressure does the brick exert on the ground if it is resting on its largest face?