Write a program to find the following pattern in c++
srajfaroquee:
Question incomplete!
Answers
Answered by
0
Explanation:
Here is your answer
Simple pyramid pattern
// C++ code to demonstrate star pattern
#include <iostream>
using namespace std;
// 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++) {
// Inner loop to handle number of columns
// values changing acc. to outer loop
for (int j = 0; j <= i; j++) {
// Printing stars
Please mark me as brainliest please
cout << "* ";
}
// Ending line after each row
cout << endl;
}
}
// Driver Function
int main()
{
int n = 5;
pypart(n);
Similar questions