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

The dishes have been sorted into cups and plates. The number of plates is four less than two times the number of cups. The dishes are 60% plates. How many cups
A rectangle has a length that is 5 inches greater than its width, and its area is 104 square inches. The equation (x + 5)x = 104 represents the situation, where
What happens if an accused declines a summary Court Martial?
Find and simplify the difference quotient f(x) = -x + 7x+5
A 200.0-g copper cylinder at 500°C is placed on a large block of ice at 0.00°C. Assume that no energy is transferred to the surroundings. What is the mass of
Please help :( real quick
Calculate how many minutes are there in two years...
What was the primary motivation behind the Non Aligned Movement during the Cold War? O A. Countries without nuclear weapons hoped to protect themselves from nuc
y = (4x^3 +8)^1/3/(x+2)^5
calculate the molecular weight of chalk​