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

Any gîrls here interested in zööm
9,835/63 what is the answer and what is the remainder
Subtract the following complex numbers: (11-7)-(16-11) A. 5+ 4i OB. 5-18i O C. -5-18i OD. -5+4i
A 40 inch board is to be cut into three pieces so that the second price is 4times as long as the first piece and the third piece is 5 times as long as the first
Which of the following was not a title taken by Augustus? O Pontifex maximus O Princeps O Augustus O Emperor O None of these
I don't get what they mean by writing an opinion Can I get some help?
Write 0.65% as a fraction in simplest form.
Omar has $660 to spend at a bicycle store for some new gear and biking outfits. Assume all prices listed include tax. He buys a new bicycle for $330.64. He buys
pls pls help whoever gets it right gets a crown
600+39 what does it add up to help