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

a person who studies word origins and meanings would most likely be a
Consider the following system of equations. y = 2x - 2 y - 2x = 5 What can you conclude about the system of equations? The system of equations is inconsistent.
What Canadian city is across a body of water from New York
Solve the system of equations.3x+3y+6z=33x+2y+6z=74x+4y+7z=4
Question: 35/8 ( write as mixed number ) Please help me very very quickly!!!!!!!!!!!!!!!!!!!
At the school carnival, Carmen sold 3 times as many hot dogs as Shawn. The two of them sold 152 hot dogs altogether. How many hot dogs did Carmen sell? 51382111
Solve the system of equations.3x+3y+6z=33x+2y+6z=74x+4y+7z=4
. What are three factors that could contribute to a source not being credible?
A storage tank shaped Like a rectangular prism is being manufactured to hold 100,000 cubic feet of natural gas. It has a length of 10 feet and a width of 25 fee
among the qualities listed on the human relations scale, the most important one for the building new relationship is?