Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hello All. I would like help with this program in C++ if it is possible: Create

ID: 3565616 • Letter: H

Question

Hello All.

I would like help with this program in C++ if it is possible:

Create a program which uses a total of 3 FOR loops, you can not use more than 3 loops in this program.

What I have got so far is:

#include<iostream>
using namespace std;

int main(){

int x,y;
char star = '*';

for(x=1; x <= 11; x++){

if((x%6) != 0){

for(y=1; y <= x ; y++){

cout << star;

}
cout << endl;
}
}

return 0;
}

The output should look like this:

*

**

***

****

*****

******

*******

********

*********

**********

*

**

***

****

*****

******

*******

********

*********

**********

I appreciate any kind of help. Thank you!

Explanation / Answer

// Code available at http://ideone.com/zll9jg

#include<iostream>
using namespace std;

int main(){

int x,y,i;
char star = '*';
for(i=1;i<=2;i++)
{
   for(x=1;x<=10;x++)
   {
   for(y=1;y<=x;y++)
       {
           cout<<star;
       }
   cout<<endl;
   }
}

return 0;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote