Skip to content

Latest commit

 

History

History
66 lines (36 loc) · 1.35 KB

README.md

File metadata and controls

66 lines (36 loc) · 1.35 KB

Triangle Star Pattern in C++

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.

Features

  • Triangle Star Pattern: Prints a triangle shape using asterisks.
  • Simple and Efficient: Uses basic C++ constructs for loop-based pattern printing.

Installation

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

  1. Make sure you have a C++ compiler installed (e.g., g++, clang, devcpp).

  2. Navigate to the project directory and compile the code:

g++ main.cpp -o triangle_star_pattern
  1. Run the compiled executable:
./triangle_star_pattern
  1. Follow the on-screen instructions to input the number of rows for the triangle.

Example

Here is an example of the triangle star pattern:

Enter the number of rows for the triangle: 5

*
**
***
****
*****

Contributing

Contributions are welcome! If you find any bugs or have suggestions for improvements, please open an issue or submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.