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

please help me please
Describe the steps that occur in the process of fission.
please helpme if possible withanother thing
Examine the scenario. A car starts from rest and uniformly accelerates to a speed of 30 mi/h in 6 s. The car moves north the entire time. Which option correctly
-25 Points- If P= (-1,-1) and Q= (5,3) are the endpoints of the diameter of a circle finds the equation of the circle.
What is W in this equation -w–11≤w–5
Change into indirect speech and please explain the rules also. Thank you so much.
When you turn on a battery-operated device, an electrical circuit is . opened closed
-PLEASE HELP ME- Lisa is 4 centimeters taller than her friend Ian. Ian is 8 centimeters taller than Jim. Every month, their heights increase by 2 centimeters. I
Suppose 34 % of students chose to study German their junior year, and that meant their junior year? lents. How many students chose not to take German