Skip to content

This C++ project demonstrates how to print a triangle star pattern. The pattern is formed by printing asterisks (*) in a triangular shape, where each row contains an increasing number of asterisks.

Notifications You must be signed in to change notification settings

logusivam/triangle-star-pattern

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

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.

About

This C++ project demonstrates how to print a triangle star pattern. The pattern is formed by printing asterisks (*) in a triangular shape, where each row contains an increasing number of asterisks.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages