Answer to Question #284714 in C++ for papi

Question #284714

Write a program using two for loops to produce the following pattern of asterisks



*

**

***

****

*****

******

*******

********


1
Expert's answer
2022-01-10T17:31:49-0500
#include <iostream>
using namespace std;


int main() {
    const int n = 8;


    for (int i=0; i<n; i++) {
        for (int j=0; j<=i; j++) {
            cout << '*';
        }
        cout << endl;
    }
    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog