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

Research a musician that has a career in radio, television, and advertising and give a brief synopsis of the role he/she plays in our culture. 100 points
(9x−4)−(2x−7) simplified
Out of 17 boys and 13 girls of a class, one student is to be selected. What is the probability of selecting a girl
(6.15x+0.24y)÷1.5+5.9x−1.6y Help plz
explain why methane has a tetrahedral shape while ammonia has a trigonal pyramidal shape even though they both have the same number of electrons​
Match each inequality to the number line that represents its solution
The War Industries Board, the War Labor Board, and the Food Administration were all created as part of the United State war effort in World War 1. Their creati
how was doretha schlosser able to live a relatively normal life, despite her jewish heritage
What are referents established
Which phrase best characterize Adam and Eve? A. Eve is shy and thoughtful, while Adam is hardworking and curious B. Eve is hardworking and impatient, while Adam