Skip to content

Repository files navigation

C Plus Plus Pattern Programs

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:

1. Increasing Triangle Pattern

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.

2. Decreasing Triangle Pattern

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.

3. Pyramid Pattern

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.

4. Square Pattern

This program generates a square pattern of stars. The nested loops iterate n times to print a square grid of stars.

5. Inverted Pyramid Pattern

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.

Contributing

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.

Author

Benjamin Caron - https://github.com/bcaron518

License

This repository is licensed under the MIT License. Feel free to use and modify the code as needed for your projects.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages