From 13ed726a2e2743d35c4fd8a6c63d33e39b4f0cbf Mon Sep 17 00:00:00 2001 From: pranjaliix <113820432+pranjaliix@users.noreply.github.com> Date: Sat, 15 Oct 2022 13:05:57 +0530 Subject: [PATCH] creating a triangular star pattern --- Pattern3.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Pattern3.cpp diff --git a/Pattern3.cpp b/Pattern3.cpp new file mode 100644 index 0000000..03ee59b --- /dev/null +++ b/Pattern3.cpp @@ -0,0 +1,20 @@ +#include +using namespace std; + +int main() +{ + int rows; + + cout << "Enter number of rows: "; + cin >> rows; + + for(int i = 1; i <= rows; ++i) + { + for(int j = 1; j <= i; ++j) + { + cout << "* "; + } + cout << "\n"; + } + return 0; +}