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

According to the Rational Root Theorem, the following are potential fox) 2x2 +2x 24.roots of -4, -3, 2, 3, 4Which are actual roots of f(x)?O 4 and 34, 2, and 3O
Package Type Amount in Package Bag- 36toy animals Box- 48Bag
Back isto rear as pit is to?
what evidence convinced Luther that the Catholic Church needed to be reformed?
6. A square has a perimeter of 28 feet.What is its area?
Dunk McStuff played in 7 basketball games. altogether he scored 65 field goals (2 points each) and 12 free throws (1 point each). Find the mean number of point
What was the first representative assembly in the English colonies in 1619
The Great Hall is open to the public, you must reserve a spot in advance. How is the comma used incorrectly in the sentence above? The comma attempts to separat
What is the role of a fungus’s fruiting body?
Which is the largest state by total area in the United States of America?