diff --git a/C++/pyramidpattern.cpp b/C++/pyramidpattern.cpp new file mode 100644 index 00000000..0d3b0917 --- /dev/null +++ b/C++/pyramidpattern.cpp @@ -0,0 +1,27 @@ + +#include +using namespace std; + +// Function to demonstrate printing pattern +void pypart(int n) +{ + + for (int i = 0; i < n; i++) { + + + for (int j = 0; j <= i; j++) { + + cout << "* "; + } + + cout << endl; + } +} + + +int main() +{ + int n = 5; + pypart(n); + return 0; +}