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

calculate the number of atoms in 2.5 moles of sodium
Name a line in the image.
Which algerbric expression represents this phrase the product of 40 and the distance to the finish line
global warming leads to rise in the water level . Do you agree ? Prove your statement
Muskan is making a fruit salad. She starts with (m + n)/(m ^ 2 + mn + n ^ 2) cup of strawberry, (m - n)/(m ^ 2 - mn + n ^ 2) cup of ...
Listen Review section 3.6 to answer this question: The cabinet represented in Fig. 3.26 and 3.27, created by Daniel Pabst, was associated with: the Ming Dynasty
The fine-structure constant, , plays a special role in the structure of matter; its approximate value is 1/137. What is the de Broglie wavelength of an electron
Under Article 1, what is the minimum age required to serve in the House of Representatives? How long must that person have been a citizen of the U.S.?
Difference between ionic product and ksp
If house is SLFHV shoe is