This project demonstrates how to print a triangle star pattern in C++. The pattern is formed by printing asterisks (*) in a triangular shape, where each row contains an increasing number of asterisks.
- Triangle Star Pattern: Prints a triangle shape using asterisks.
- Simple and Efficient: Uses basic C++ constructs for loop-based pattern printing.
To use this project, simply download or clone the repository:
git clone https://github.com/logusivam/triangle-star-pattern.git
Alternatively, you can directly copy the triangstars.cpp
file into your project directory.
Usage
-
Make sure you have a C++ compiler installed (e.g., g++, clang, devcpp).
-
Navigate to the project directory and compile the code:
g++ main.cpp -o triangle_star_pattern
- Run the compiled executable:
./triangle_star_pattern
- Follow the on-screen instructions to input the number of rows for the triangle.
Here is an example of the triangle star pattern:
Enter the number of rows for the triangle: 5
*
**
***
****
*****
Contributions are welcome! If you find any bugs or have suggestions for improvements, please open an issue or submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.