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

Eric has 240 coins in his collection 11/20 of the coins are pennies 4/20of the coins are nickels the rest of the coins are quarters How many quarters are there
What is the sum of 40/100+60/100+30/100+81/100
can somebody tell me how to solve this i'm begging.
How do i Evaluate (5)(6+1-3)
PLEASE HELP ME I'M CONFUSED.
The reader can infer that Sleepy Hollow is - * 1 point A dreamy B mysterious C scary D haunted
Would you prefer a loan with simple interest or compound interest? Why? NEED ASAP!!!!! WILL MARK BRAINLIEST
a dialogue about education between a city girl and a village girl
If a __________ tire blows out, the vehicle will pull sharply in the direction of the blowout?
Each day, you watch television for 30 minutes and work on homework for m minutes. Write and simplify an expression that shows how many minutes you spend watchin