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

18. Which number rounds to 0.94 when rounded to the nearesthundredth?
Whats the next number 0 3 8 15 24 35
the formula for converting Celsius temperatures to Fahrenheit temperatures is a linear equation. water freezes at 0 degree Celsius, or 32 degree Fahrenheit. fin
Neo could choose from 3 different pants, 5 different shirts, and 4 sweaters. How many different combinations of 1 pant, 1 shirt and 1 sweater could he choose?
Describe Novgorod art. How is it different from or similar to Byzantine art?
What are 3 ways to be considered a natural born citizen in the U.S.?
what determines how a star develops after the red gaint stage in its cycle? what two things can happen in the life of a massive star after it passes from the su
What are the coordinates for the image of point N, when the figure is translated 3 units to the right and 3 units up?
Why are Americans eating more calories today than they did 40 years ago? A.economy has improved. B. Portion sizes and calories counts have increased. C. The g
help me with this maths literacy