> C++ Array Help?

C++ Array Help?

Posted at: 2014-12-18 
/*Honestly speaking, the number of columns is not required, the rows and maximum columns have to be equal only, but still, as per ur specifications, here is the code*/

#include

#include

int main()

{

int rows,cols,i,j;

cout<<"\nEnter the number of rows:";

cin>>rows;

cout<<"\nEnter the number of columns:";

cin>>cols;

for(i=0;i
{for(j=0;j<=i;j++)

{

cout<<"*";

}

cout<<"\n";

}

getch();

}

How do you make a program that asks the user to input a number of rows and columns and prints asterisks according to the input.

For Example:

Enter number of rows: 10

Enter number of columns: 10

The program will then display:

*

**

***

****

*****

******

*******

********

*********

**********