
Patrick B. answered 04/20/21
Math and computer tutor/teacher
using namespace std;
#include <iostream>
#define MAX_LINE (55) //this may vary depending on your system
Go()
{
int n=-1;
while (n<1)
{
cout << "Input positive integer :>";
cin >> n;
if (n>=MAX_LINE)
{
cout << "too many - won't fit, sorry" << endl;
n=-1;
}
}
for (int iLoop=0; iLoop<=n; iLoop++)
{
for (int jLoop=n; jLoop>0; jLoop--)
{
if (jLoop>iLoop)
{
cout << " ";
}
else
{
cout << "*";
}
}
cout << endl;
}
}
main()
{
Go();
}