Java for loop Question 6

Question

What is the output of the following code?

public class Main {

  public static void main(String[] args) {

    for (int row = 0; row < 5; row++) {

      for (int column = 0; column <= row; column++) {

        System.out.print("*");

      }//from   w  w  w  .  j ava  2s. co m

      System.out.println();

    }
  }
}


*
**
***
****
*****

Note




PreviousNext

Related