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

I want to be a vocal advocate for nature. I reject the idea that I am too young to make a difference. I recently helped a group with a river cleanup. I was mort
Two numbers whose product is 1 are called multiplicative inverses or
when a medication error occur you should first
I need help pleaseee!
the value of x when y=16
rearrange the words below into a meaningful sentence. what's the first letter of the last word in that sentence.help the knot needed George tying shoelace
The ancient Athenian playwright Aeschylus used the story of Prometheus and Zeus as a basis to discuss tyranny and injustice, with Zeus portraying the role of an
Which list correctly orders A, B, and C from least to greatest when A = –8, B = StartAbsoluteValue negative 6 EndAbsoluteValue, and C = StartAbsoluteValue 11 En
Find the surface area of the rectangular prism. 7 km 5 km 3 km
Explain LCD and give two example​