Description:
Print a right-angled triangle of stars.
Print a right-angled triangle of stars.
Java Code
public class StarPattern {
public static void main(String[] args) {
for (int i = 1; i <= 5; i++) {
for (int j = 0; j < i; j++) System.out.print("* ");
System.out.println();
}
}
}
Expected Output
*
* *
* * *
* * * *
* * * * *