 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how you can print these two patterns in C programming. Before starting, you can note my information, you can follow or subscribe my YouTube channel through this link youtube.com slash sanjaygupta underscore tech school. You can download my Android app that is Techimus which is available on Google Play. Now coming onto the topic, first I am going to display this pattern and in this pattern I am printing this half triangle that is one, two, three, four and five rows. Then I will be printing the remaining rows and then I will display the second pattern. So here I am using these three variables i, j and n and is reading number of rows. So in this pattern, suppose number of rows are five, so this pattern will be printed. If number of rows will be six, then 12 rows will be displayed for this pattern. So first I am implementing i loop which will repeat n times and it is responsible for printing rows. Inside this loop, I am implementing another loop which is j starting from one and it is dependent upon i. Inside this loop, I am printing asterisk. This loop is responsible for columns. After completion of this j loop for new line, printf slash n is available. Now I am executing this code. You can see the output. Half triangle is printed. This half triangle is printed here. Now I have to print this half remaining triangle in reverse order. So for that purpose, I am just copying these instructions and I am pasting it just after these code. So I am changing it i equals to n, i greater than equals to 1 and i minus minus. So above for loop combination will print starting five rows and second for loop combination will print remaining five rows in reverse order. So now I am executing this code. I am entering five as number of rows. You can see the output. First pattern is printed on console. Here total 10 rows are available. Now if we talk about second row, sorry, second pattern, here you can see starting five rows are same. But here this row is missing. Here this row is missing. So for this purpose, instead of starting it from n, I am starting it from n minus 1. So it will print total four rows if value of n is five because it is starting from four right now instead of five. So again I am executing this code. I am entering five. You can see the output. You can compare the output. This time second pattern is printed on console. So this row is missing and this pattern is printed with the help of return code. So I hope you have understood how you can print both the patterns with the help of these nested loops in C programming. If you want to watch more programming related videos, you can follow my YouTube channel through youtube.com slash sanjaygupta underscore tax school link. Thank you for watching this video.