Write a program FloydExample3 to display the output as below using control structures

0

Assignment: Module 03- Part 02

Write a program FloydExample3 to display the output as below using control structures

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:

* * * * 
* * * 
* * 
*   

👉Write a class FloydExample1 to display the output as below using control structures Enter the value of Floyd triangle 3👈

Post a Comment

0Comments
Post a Comment (0)

#buttons=(Accept !) #days=(20)

Our website uses cookies to enhance your experience. Learn More
Accept !
✨ Updates