Menu BAR

FEEL FREE TO ASK ANY PROGRAM and please mention any error if you find it

10 Feb 2024

JAVA PROGRAM - RIGHT TRIANGLE STAR PATTERN


 ## Write a Java Program to print the Right Triangle Star Pattern



                                                                        *
                                                                        *  *
                                                                        *  *  *
                                                                        *  *  *  *
                                                                        *  *  *  *  *



 public class RightTriangleStarPattern { 

                        public static void main(String[] args) { 
                                            int rows = 5; 

                                            for (int i = 1; i <= rows; i++) { 
                                                            for (int j = 1; j <= i; j++) { 
                                                                                System.out.print("* "); 
                                                            
                                            System.out.println(); 
                                            
                        } 
}

No comments:

Post a Comment