Skip to content
This repository has been archived by the owner on Dec 19, 2022. It is now read-only.

Commit

Permalink
Merge pull request #314 from vaibhavx42/pattern
Browse files Browse the repository at this point in the history
Created full pyramid Pattern
  • Loading branch information
Almas-Ali authored Oct 30, 2022
2 parents 91770ca + 462417c commit e6f9108
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions C++/full pyramid.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
-Question will be to print full pyramid taking rows as an input from the user

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

- > Program - >

#include <iostream>
using namespace std;

int main()
{
int space, rows;

cout <<"Enter number of rows: ";
cin >> rows;

for(int i = 1, k = 0; i <= rows; ++i, k = 0)
{
for(space = 1; space <= rows-i; ++space)
{
cout <<" ";
}

while(k != 2*i-1)
{
cout << "* ";
++k;
}
cout << endl;
}
return 0;
}

0 comments on commit e6f9108

Please sign in to comment.