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 the earliest day of gestation that an equine pregnancy can be confirmed using ultrasound?a) Day 5b) Day 10c) Day 14d) Day 21
The probability of the next parent Ms. O’Connor surveys being in favor of the requirements is approximately 61.36%. The following sentence or sentences contain
How did the Whigs approach the election of 1840? [Select all that apply.]
I am a neuron; from what part of the brain did I develop?
What is career month all about
Determine the mass of sugar needed for 100.0 mL of a 0.0500 M C12H22011 stock solution.
please help. The figure below is a triangle with three unknown angles.
Find the exact value of s in the given interval that has the given circular function value. Do not use a calculator. [π, 3π/2]; sin s= -1/2 s= ___ radians
What is the cost of 2 1/2kgof tomatoes at #1. 50 per kg
Who was with God in the beginning? Group of answer choices Adam Lucifer The Word John