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

A car dealership is having a sale in which costomers pay 85% of the retail price for a new vehicle. Keith is buying a vehicle with a retail price of $36000. He
The rectangle shown has a perimeter of 7272 cm and the given area. its length is 66 more than four timesfour times its width. write and solve a system of equati
You invest an initial $1,000 in an account that has an annual interest rate of 2%, compounded quarterly. how much money will you have in the account after 5 yea
How is communism different from capitalism?
Read the narrative and determine the point of view: "As the teen walked along the beach with his mother, he knew he had to tell her the verifiable truth. He fi
How have party leaders sought to deal with the cumbersome legislative process?
Was prohibition responsible for the rise of al capone
I need the description of how to draw a parallel line and a perpendicular line.
Why didn't greg ask mom to drive him to school sooner?
given tan (0) = 4/3 and sin (0) =-4/5,find cos (0)