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

balancing chemical equation helpp me H3PO4+KOH---> K3PO4+H2O some one balance this please help me
pls help me with is question
99 POINTS. DON'T GUESS WHICH OF THESE VEGETABLES HAVE THEIR OWN IMMUNE SYSTEM? SWISS CHARD POTATO ARTICHOKE MUSHROOM
What was thurgood marshalls occupation? A.Senator B.Lawyer C.Farmer
Please help me ima give Brainly and a like thank you
how many miles are in 10,560 yards? 1 mi. = 1,760 yds. 10,560 yds. = ? mi.
Which compound can be used to preserve biological specimens? A central C is double bonded to an O, and single bonded to 2 H. A chain, reading from left: C H 3 b
Determine if the sequence is geometric. If it is, find the recursive formula. -4,2,-10, 14,
Why is social security and Medicare spending expected to in crease further in the near future? -) the people who qualify will all receive maximum benefit -) the
aye yo help a homie out