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

Which of the following geographic characteristics of the United States has had a positive influence on the country’s political status? Access to both the Paci
What is the next step in the suns life cycle after it has used up its hydrogen fuel
What is the answer? I guessed a but I'm not sure.
What is the basic difference between ultraviolet, visible, and infrared radiation?
What is the highest electronegativity value in the periodic table?
A 3-week-old infant is diagnosed with pertussis. which antimicrobial agent would the nurse expect the physician to prescribe?
What is 7/11 in decimal for rounded to the nearest thousandth
If a = 2 + i, and b = 3 – 2i, whats b/a?
butterflies laying their eggs on milkweed plants occurs at what level of biosphere hierarchy
Which individual or group best completes the diagram, which represents the hierarchal structure of the federal bureaucracy?a. the white house chief of staffb. c