This Java program prints a pyramid pattern of stars with increasing spacing between stars. It uses nested for loops, where the outer loop controls the rows and inner loops handle spacing and printing stars. The program initializes a count variable, then loops to print rows with stars separated by the count that increases by two each iteration, producing a triangular pyramid shape.
Download as TXT, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
53K views
Java Program To Print Pyramid Pattern of Stars
This Java program prints a pyramid pattern of stars with increasing spacing between stars. It uses nested for loops, where the outer loop controls the rows and inner loops handle spacing and printing stars. The program initializes a count variable, then loops to print rows with stars separated by the count that increases by two each iteration, producing a triangular pyramid shape.