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

The premium of a health insurance plan refers to the _____. A.employer contribution B.total cost of insurance coverage C.employee contribution D.best coverage
what is the density of an object that has a mass of 550 grams and displaces 25 ml of water? select all that apply. 22 ml/g .04 ml/g 22 g/ml 22 g/cm 3
hi there can anyone help me out with this question please
A generalized term for animal organs that produce sex cells is a _____. gametangium antheridium testis gonad
Yo escribí__ en el sobre
Levittown became the first mass-produced suburban __________ in new york in 1948
The first quartile of a data set is 41, and the third quartile is 57. Which of these values in the data set is an outlier? A. 83 B. 39 C. 19 D. 73
may someone help me out with this
hi there can anyone help me out with this please
Study Island- Rational & Irrational Numbers