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

Giovanni Battista Tiepolo was known for his _______ in the rococo style
need help with this one
Send help!!!!!!!!!!!!!!
Which point is an x-intercept of the quadratic function f(x) = (x + 6)(x – 3)? A:(0,6) B:(0,–6) C:(6,0) D:(–6,0) PLZ ANSWER ASAP
Leticia stretched for 8 minutes and then jogged around her block for several times
Read this line from Walt Whitman’s poem “Song of Myself” “I sound my barbaric yawp over the roofs of the world” Which of these poetic devices does he use her
Which should be done when gathering an exemplar (the sample taken from a suspect)? Choose ALL answers that are correct. 1. Dictate the text of the questioned do
An average grade of 80 on all exams in a course is needed to earn a B in the course. On her first four exams, Chuck’s grades are 96, 65, 79, and 87. What is the
Which 2 processes allow water to enter the atmosphere
In a jar of red and green jelly beans, the ratio of green jelly beans to red jelly beans is 5:3. If the jar contains a total of 160 jelly beans, how many of the