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

If a speech addressed the importance of adopting a school-wide recycling program, its purpose would be _____. A. to suit the occasion B. to entertain C. to info
The soldiers cast lots for Jesus' Choose... belt garments sandals
The best description of a bicameral system is: A.a system that allows incumbents to move between the two chambers during elections B.the sharing of power be
A farmer is filling hole in his farm dirt. He measures the holes of a rectangular prism measuring 12 feet by 4 feet by 3 feet. If the cost of dirt is 1.25 per c
I need to know the answer
In need help with the last part
Explain the process of separating a mixture consisting of iron fillings and sand in a plastic bowl.
Just write a comment and receive a 24 points as a gift from a newbie :)
Which value of a from the set {3, 4, 5, 6} makes this equation true? 2(a + 4) = 16 A.) 3 B.) 4 C.) 5 D.) 6
All of the following could be considered reconstruction except scientists assume an area was once undersea due to the types of rock deposits scientists assume