This repository contains five different pattern programs written in C++. Each program generates a specific pattern of stars (*) when executed. These patterns are useful for understanding nested loops and how to control output formatting in C++. Below are the details of each program:
This program generates an increasing triangle pattern of stars. The outer loop runs for the specified number of rows, and the inner loop prints stars in increasing order.
This program generates a decreasing triangle pattern of stars. The outer loop runs from the input number of rows down to 1, and the inner loop prints stars in decreasing order.
This program generates a pyramid pattern of stars. It calculates the number of spaces needed before each row to center-align the stars, then prints the stars.
This program generates a square pattern of stars. The nested loops iterate n times to print a square grid of stars.
This program generates an inverted pyramid pattern of stars. Similar to the pyramid pattern, it calculates the spaces needed for alignment and prints the stars accordingly.
If you'd like to contribute to this repository or improve the code examples, please feel free to open an issue or submit a pull request. Your contributions are welcome.
Benjamin Caron - https://github.com/bcaron518
This repository is licensed under the MIT License. Feel free to use and modify the code as needed for your projects.