Skip to content

Commit

Permalink
Merge pull request #13 from Dev092/patch-1
Browse files Browse the repository at this point in the history
Update main.cpp
  • Loading branch information
ShaileshKumar007 committed Oct 13, 2022
2 parents d6dd009 + 27ae481 commit 2fc42d9
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions loops/half_diamond_pattern/main.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
#include<iostream>
using namespace std;

void half_diamond_pattern(int n){
//Enter your code here
int i, j;


for (i = 0; i < n; i++) {
for (j = 0; j < i + 1; j++)
cout << "*";
cout << "\n";
}


for (i = 1; i < n; i++) {
for (j = i; j < n; j++)
cout << "*";
cout << "\n";
}
}
int main()
{
{
int n;
cin>>n;
half_diamond_pattern(n);
Expand Down

0 comments on commit 2fc42d9

Please sign in to comment.