Assignment: Module 03- Part 02
Write a program FloydExample3 to display the output as below using control structures.
* * * *
* * *
* *
*
public class FloydExample3 {
public static void main(String[] args) {
for (int i = 4; i >= 1; i--) {
for (int j = 1; j <= i; j++) {
System.out.print("* ");
}
System.out.println();
}
}
}
The output of the above code will be:
* * * *
* * *
* *
*