Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 28 additions & 13 deletions Pattern/Pattern_Pyramid180.cpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,31 @@
#include<iostream>
// C++ code to demonstrate star pattern
#include <iostream>
using namespace std;
int main(){
cout<<"NO OF ROWS:";
int n;
cin>>n;
for(int i=1;i<=n;i++){
for(int j=1;j<=i;j++){
cout<<"* ";

}
cout<<endl;
// Function to demonstrate printing pattern
void pypart(int n)
{
// Outer loop to handle number of rows
// n in this case
for (int i = 0; i < n; i++) {

}
return 0;
}
// Inner loop to handle number of columns
// values changing acc. to outer loop
for (int j = 0; j <= i; j++) {

// Printing stars
cout << "* ";
}

// Ending line after each row
cout << endl;
}
}

// Driver Function
int main()
{
int n = 5;
pypart(n);
return 0;
}