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

Which equation has no solution? 4(x + 3) + 2x = 6(x + 2) 5+2(3 + 2x) = x + 3(x + 1) 5(x + 3) + x = 4(x + 3) + 3 4 + 612 + x) = 2(3x + 8)
plz help I will mark you brainlist plz help ​
If 9 is subtracted from a certain number and the difference is divided by 3, the result is 1 more than 1/7 of the original number. Find the original number.
Please help!! I've been getting them all wrong
Which of the following is another name for cinematographers? (Select all that apply). lighting specialists production manager directors of photography camera op
Water is a product of cellular respiration. True false question. True False
The price of an item is reduced by $1.39. The new sale price is $92.44. What is the original price
Which is an estimate of 75 to the nearest whole number?
w h a t is five pl us t h r e e
HELP MEEEEEE PLZZZZZZZZZZZZZZZZZZZZ