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’s 3/8 off 20 inches
XYZ borrowed $50,000 this year. Half of the loan will be repaid next year and the remainder will be paid the following year. How will the $50,000 be reported on
About 32% of the population in a large region are between the ages of 40 and 65, according to the country's census. However, only 2% of the 2100 employees at a
(x^2−1)(3x−4)(3x+4) what is the product
help me with this asap​
If a car travels 400m in 20 seconds how fast is it going? Calculating Speed
Are you optimistic or pessimistic about the future of our planet? why
• the court system makes a ruling on a case • legislators amend an old policy or pass a new policy Which is a good title for the examples in the box above? A.
Circle O is inscribed in the given triangle. What is the perimeter of the triangle?
what was the Korean war ?