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

Which describes how the body’s immune system works?
Describe copyright statute, disclaimers, and filing procedures.
What does the declaration say was necessary?​
Which is false about Chaucer's travels? A. He traveled to mainland Europe only because he was a solider when he was young. B. He traveled to mainland Europe as
can someone just help me! I can't figure it out and nobody is responding to me with some steps or the answer! I really appreciate it if you take your time to he
When Sandy Koufax pitched, his team * 10 points A. Won B. Lost
What can this map tell us about inequality in the 1700s? Explain your answer.
Read the paragraph. Salvador Dalí, born Salvador Felipe Jacinto Dalí y Domenech. In Figueras, Spain in 1904. He was a Surrealist painter and printmaker; some of
how u write 40 r28 in mixed number
Write mixed fraction as a decimal?