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 a5 in the sequence defined as follows? an = 5x2^(n-1)
Why does the author include details about the narrator’s brother making the baseball team in "The All-American Slurp"? to reveal the importance of physical fit
What is the solution to 4-6b=19
5. Explain each of the following... Federal Circuit Courts of Appeals: Federal District Courts - Trial Courts:
This is an area of land managed by Native American tribes, under the Department of the Interior's Bureau of Indian Affairs. Because Native American tribes have
Erika made $147 selling her guitar online. She spent $98 of it on new clothes. One shirt did not fit so she returned it for $32. How much of her guitar sale ear
The Miller family drove 1,240 miles on their road trip. If their trip took 4 days, how many miles did they travel per day?
What is the term for moving pictures? _____ is the art of making moving pictures.
How many grams of chlorine gas can be produced when 50.0 grams of aluminum chloride decompose? 2AlCl3→ 2Al + 3Cl2
Solve for - 2/5 x = 12