diff --git a/star pattern.cpp b/star pattern.cpp new file mode 100644 index 0000000..26ac9ed --- /dev/null +++ b/star pattern.cpp @@ -0,0 +1,26 @@ +#include + +using namespace std; + +int main() { + int n; + cin >> n; + int row = 1; + while(row<=n) { + //space print karlo + int space = n - row; + while(space) { + cout<<" "; + space = space - 1; + } + int col = 1; + while(col<=row) { + cout<< "*"; + col = col + 1; + } + cout<