Pre-requisite - Use two loops - one for rows and one for coloums (consider the pattern as matrix)
- Number of lines = Number of rows = Number of times outer loop will run.
- Identify for every row number -
- How many cols are there .
- And, Types of elements in cols.(ex: * , 1 etc)
- Print stuff at last.
- Write one for S.0.p to break the line.
1.
* * * * *
* * * * *
* * * * *
* * * * *
* * * * *
2.
*
* *
* * *
* * * *
* * * * *
3.
* * * * *
* * * *
* * *
* *
*
4.
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
5.
*
* *
* * *
* * * *
* * * * *