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

Which inequality has a solid boundary line when graphed? a. y<-x-9 b. y<1/9x+9 c. y>-1/9x d. y>_9x+9
What was the chief value of the colonies
Willie sometimes feels uncertain that he has made the right decision when he spends his money or when he agrees to participate in activities with his friends. H
What is the slope of the line passing through the points (2, −5) and (4, 1)?
What multiples to 9 but adds to 3
Yale has a square-shaped garage with 228 square feet of floor space. she plans to build an addition that will increase the floor space by 50%. what will be the
during a class election the ratio of students who voted for cqndidate A compared to candidate B was 10:7 if candidate A received 50 votes what is the combined a
Why are there few volcanoes in the Himalaya?
How did most citizens of the Byzantine Empire relate to the Roman Empire? They felt that Roman history was irrelevant to them. They created art that was iden
Calculate the root mean square velocity of F2,Cl2, and Br2 at 304 K .