Question #301200

Make a C++ program using do while loops that will print this output:


*

**

***

****

*****


Expert's answer

#include<iostream>

using namespace std;

int main()
{
	int i=1;
	do
	{
		int j=1;
		do
		{
			cout<<"*";
			j++;
		}while(j<=i);
		cout<<endl<<endl;
		i++;
	}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!

LATEST TUTORIALS
APPROVED BY CLIENTS