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

What is a key principle of a market economy?
Which one is it? Is it A. B. C. or D.?
You should do all of the following when completing a job application except _____.
1. Which conversion requires division? A. millimeter --->> centimeter B. kilometer --->> meter C. centimeter --->> millimeter D. m
Given the terms a10 = 3 / 512 and a15 = 3 / 16384 of a geometric sequence, find the exact value of the term a30 of the sequence.
After a fetus has developed for only three months, what is the skeleton made of? A. Muscle B. Bone C. Cartlage D. Tendon (I think it's A)
Ted is a fashion designer. Where is he most likely to work? architectural firm advertising firm publishing firm apparel-manufacturing firm
Which of the equations below could be the equation of this parabola?
geometry question PLS HELP!!!!!!!!111
List the steps involved in the nitrogen cycle