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

In a command economy, many basic needs are provided by the A. upper class B. government C. small business owners D. individual communities Please select the bes
Can you guys help me solve this problem
The chef has not made the cake.Turn it into the Passive Voice.​
If costs $3. 45 to buy 3/ 4 lb of chopped walnuts. How much would it cost to purchase 7. 5 lbs of walnuts?.
what dose Expository means?
PLEASE HELP! ILL GIVE BRAINIEST!!! A spinner is divided into 10 equal sections numbered 1-10. Find the probability of spinning a 1, 3, or eight. Write your answ
What was the largest group in the colonies in the year leading up to the American revoulation
19. 18. Multi-Step Sara and Jon each ordered a medium pizza. Sara ate 3/8 of her pizza for lunch and 1/4 for a snack. Jon ate 1/2of his pizza for lunch and 1/4
What is the subject of this poem? the value of precious metals the colors of nature the potential within people the inevitability of change.
Why do athletes choose to take performance enhancing drugs?