Pattern 4 – Rectangular shaped pattern with numbers – C Program



About this program

This is a C program wich will consist of five rows and five columns. Unlike the pattern 3, this program will contain only 1 2 3 4 and 5 in each row. The output will look something like this –


Here our pattern will have 5 rows and 5 columns. So we need a for..loopto print 5 columns and we also need another for..loop to print the 5 rows.

In the pattern 3 program you have seen that we were printing the value of variable ‘i’. But in this program we are going to print the value of ‘j’.



You May Also Like

Leave a Reply

Your email address will not be published. Required fields are marked *