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

seth traveled 1 mile in 57.1 seconds. About how fast does Seth travel in mph?
what is the root word for circumspect
the mass of protons and neutrons is a. barely more than the mass of the electrons. b. significantly more than the mass of the electrons. c. equal to the mass of
What is the process of the brain integration ?
How many elements are in the set {whole numbers between 3 and 15}? 11 12 13
simple subject of the sentence, She went on a trip to Florida last summer
Ralph likes 25 but not 24;400 but not 300;144 but not 145; does he like 10,50,124,200, or 1600
What term means the spontaneous loss of a pregnancy 20 or more weeks after the pregnancy began?
which of the following is not a function of hormones? responding to external stimuli regulating growth, development, and behavior maintaining homeostasis exchan
why is the allusion to christ stilling the waves on the lake of galilee appropriate in "the wreck of the hesperus"? a. the poem describes the miracles of christ