
Patrick B. answered 04/20/21
Math and computer tutor/teacher
using namespace std;
#include <iostream>
#define MAX_LINE (120) //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 rowLoop=0; rowLoop<n; rowLoop++)
{
for (int columnLoop=0; columnLoop<n; columnLoop++)
{
cout<<"*";
}
cout << endl;
}
}
main()
{
Go();
}