sujana-kamasany / javacodes

A repository that will guide in making your first contribution.
30 stars 109 forks source link

Create starPyramidPattern.java #171

Closed Diptigit11 closed 1 year ago

Diptigit11 commented 1 year ago

This Java code is designed to create a pyramid pattern made of stars. It uses two loops to achieve this: The outer loop, controlled by the variable i, runs from 1 to the desired height of the pyramid (specified by the value of n). The inner loop, controlled by the variable s, prints spaces before the stars. The number of spaces decreases as you move down the pyramid. For each row, it first prints spaces to create an indentation on the left side and then prints stars (asterisks) to form the pyramid. The number of stars increases with each row.

By adjusting the value of n, you can control the height of the pyramid. The program creates a visually pleasing pyramid pattern.

Diptigit11 commented 1 year ago

58 Please review my code and merge it under the Hacktoberfest-accepted label.Thank You