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

Explain why the colonists formed a representative government.
how natural selection could lead to the trait distribution?​
The position of a particle
Where did Roman rule continue after the original Roman Empire fell?
the area of a square rug is 72 square feet. what is the approximate length of one side of the rug?
Write the expression in the standard form a+b i (8-8i) + (1+6i )= (simplify the answer)
What did Europeans want from India ?
You hang a book bag on a spring scale and place the bag on a platform scale so that the platform scale reads 29.7 N and the spring scale reads 17.6 N.
Eliana has $2600 to invest for 6 months. If she needs the money to earn $104 in that time, at what rate of simple interest must Eliana invest?What equation woul
I need help with this please