Write a program Using loops to display the following patterns –
(i)
**********
(ii)
*******************
(iii)
*
**
***
****
*****
******
*******
********
*********
**********
(iv)
*
**
***
****
*****
******
*******
********
*********
**********
***********
************
*************
**************
***************
****************
*****************
******************
*******************
********************
(v)
*********
*********
********
*******
******
*****
****
***
**
*
(vi)
********************
*******************
******************
*****************
****************
***************
**************
*************
************
***********
**********
*********
********
*******
******
*****
****
***
**
*
Your program should use loops to display all 6 patterns with one execution.
Input from the keyboard: the number of rows,
the number of asterisks in the first row,
1 to increment asterisks in each following row, or
-1 to decrement the number in following rows, or
0 to keep the same number as in the first row.
Sample screen dialog and output
HOMEWORK 5 Part 1
Enter the number of rows 1
Enter the number of asterisks in the first row 10
Enter 1 if you want *'s to increase on each row, -1 for decrease, 0 for no increase 0
**********
Enter the number of rows 1
Enter the number of asterisks in the first row 20
Enter 1 if you want *'s to increase on each row, -1 for decrease, 0 for no increase 0
********************
Enter the number of rows 10
Enter the number of asterisks in the first row 1
Enter 1 if you want *'s to increase on each row, -1 for decrease, 0 for no increase 1
*
**
***
****
*****
******
*******
********
*********
**********
Enter the number of rows 20
Enter the number of asterisks in the first row 1
Enter 1 if you want *'s to increase on each row, -1 for decrease, 0 for no increase 1
*
**
***
****
*****
******
*******
********
*********
**********
***********
************
*************
**************
***************
****************
*****************
******************
*******************
********************
Enter the number of rows 10
Enter the number of asterisks in the first row 10
Enter 1 if you want *'s to increase on each row, -1 for decrease, 0 for no increase -1
**********
*********
********
*******
******
*****
****
***
**
*
Enter the number of rows 20
Enter the number of asterisks in the first row 20
Enter 1 if you want *'s to increase on each row, -1 for decrease, 0 for no increase -1
********************
*******************
******************
*****************
****************
***************
**************
*************
************
***********
**********
*********
********
*******
******
*****
****
***
**
*
Programmer: insert your name here