Welcome to Westonci.ca, the place where your questions are answered by a community of knowledgeable contributors. Get immediate answers to your questions from a wide network of experienced professionals on our Q&A platform. Get quick and reliable solutions to your questions from a community of experienced experts on our platform.

JAVA

Write a program to display the given pattern:
3
5 6
8 9 10
12 13 14 15​


Sagot :

tonb

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...