Write a Java program to print the numbers in triangle format?
/*Q. Write a Program to print the Numbers in Triangle format?*/ public class NumbersInTriangle { public static void main(String[] args) { int rows = 10; /* give input here*/ for (int i = 1; i <= rows; i++) { int number = 1; for (int j = 1; j <= i; j++) { System.out.format("%2d",number++); } System.out.println(); } } }