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

Instructions:Select the correct answer. Which box plot represents a symmetrically distributed data set?
Which quotation from the text BEST supports the theme of isolation? A. "An unsought pathos came hand in hand with awe." B. "Something must surely be amiss with
i) 0xBED into 3-base representation ii) 3217 into 2-base (binary) representation
Whats the answer for question 4?
One major economic impact of the civil war was the ?
Can anyone help me on this
How do the organelles move around In a cell
what are the ethical issues at stake when companies permit employees to use personal technology on the job ? what are tge implications?
Compare the basic foreign policy of the early United States early on to that of today
Which of the following terms is defined as the stress in psi (pounds per square inch) at which a fastener assumes a specified limited permanent set? A