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 owner of a gift shop keeps holiday decorations in a rectangular box that has a a volume of 30 cubic feet. The length of the box is 4 feet and the hight of t
Two whole numbers A and B satisfy the following conditions. Find A and B . A−B=25 A:B is equivalent to 13:8
An object with a mass of 50 kilograms is supported at a height of 3 meters above the ground. What's the potential energy of the object with respect to the groun
in what time period did archaea first formed?
What will any number times 100% equal? Why?
Abraham Lincoln was assassinated
If f(x)=-8x+4, then f^-1=
B is force of ____, or the force with which the block pushes back against the force pushing upon it
f(x) = 2x-8; g(x) = x-5 what is the value of (gof) (6)? a 6 b 1 c -6 d -1
Which of the following best describes an atom? Select one: a. Consists of elements b. Consists of compounds c. Biggest unit of a compound d. Smallest unit of a