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

the angles of a triangle are 2x, 3x, and 4x degrees. Find the value of x
What types of natural disasters could strike colorado?
The ancient greek sculptor who created the bronze known as poseidon (1.136) used this part of the body as a standard unit for proportional measurement in the wo
[tex]cos(3theta) =-1 [/tex]
What do scientists do when they make a mistake?
A student estimated a mass to be 250 g but, upon carefully measuring it, found the value to be 240 g. What is the percent error of the estimated mass if the mea
serious health question: MY TALIBONE HURT'S SOOOO BAD
This type of word evokes precise, vivid mental images and thus help to convey a message
Which sentence best translates "They don't eat it"? A. No lo comes. B. No lo comemos. C. No lo comen. D. No lo van a comer.
How many sides does a polygon have if the sum of its interior angle =900 degrees?