I have a question that i am having difficulty with. The question is to write a function that creates the following pattern given the height(number of rows)which must be even. Please help!
*
***
*****
*******
*********
*********
*******
*****
***
*
Here is the code i have so far
#include <iostream>
using namespace std;
int main ()
{
int limit;
int row;
//Read limit
cout << "\nEnter an even number:";
cin >> limit;
for (int row = 1; row <= limit; row++)
{
for (int col = 1; col <= row ; col++)
cout << '*';
cout << endl;
}
for (int row = 1; row <= limit; row++)
{
for (int col = row; col <= limit ; col++)
cout << '*';
cout << endl;
}
return 0;
}