Write a program using nested loop to produce a rectangle of *'s with 6 rows and 20 *'s per row in python
Answers
Answer:
Program to print hollow rectangle or square star patterns
Hollow rectangle star pattern :
The task is print below hollow pattern of given dimension.
********************
* *
* *
* *
* *
********************
Explanation:
Input number of rows and columns.
For rows of rectangle run the outer loop from 1 to rows.
for (i = 1; i < = rows; i++)
For column of rectangle run the inner loop from 1 to columns.
for (j = 1; j < = columns; j++)
Print star for first or last row or for first or last column, otherwise print blank space.
After printing all columns of a row, print new line after inner loop.
********************
* *
* *
* *
* *
Explanation:
☝️This is the answer