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 rectangle has an area of 30 square units and a perimeter of 34 meters.what are the dimensions of this rectangle
How did professors feelings about black well as a student change over time?
How do you do 720 divided by 10 with the exponet of 3
What is the value of 6P6?  A.1  B.36  C.720  D.46,656
what is the definition of bureaucratic personality
What is the simplified form of the expression 2 * [(1+14)*7]+6/0.5^3?
For f(x)=3x+4, find f(2) and find x such that f(x)=17
The length of an arc of a circle is equal to 1/5 of the circumference of the circle. If the length of the arc is 2π, the radius of the circle is
Who benefitted from the corrupt bargain?
Of the model cars manufactured in September,1/5 were models of NASCAR cars and 1/3 were world were 2 vintage models.how many cars manufactured in September were