Answer to Question #205291 in C++ for Nurul Aliss

Question #205291

write a program to print a star

*

**

***

****

****

using for next statement



1
Expert's answer
2021-06-10T13:18:17-0400
#include<iostream>
using namespace std;
int main()
{
    int i=0,j=0;
    do
    {
        do
        {
            cout<<"*";
            j=j+1;
        }while(j<=i);
        j=0;
        cout<<"\n";
        i=i+1;
    }while(i<5);
}

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