Guess the output of Java code
public class Main {
public static void main(String[] args) {
    int rows = 5;
    for (int i = rows; i >= 1; --i) {
      for (int j = 1; j <= i; ++j) {
        System.out.print(j + " ");
      }
      System.out.println();
    }
  }
}


Posted on by