 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how you can print this pattern in C programming. Before starting, you can note my information. You can follow or subscribe my YouTube channel through this link that is youtube.com slash sanjaygupta underscore tech school. You can download my app that is Techim is based on programming which is available on Google Play. Now, first we have to analyze this pattern how we can display it. So here you can see some spaces are available and then S to risk symbol is available. So here you have to implement three loops. First will be representing which row you are printing. Second loop is responsible for printing this space and third loop will be printing this S to risk. Now we have to identify how many spaces are available here. So first I am modifying this pattern like this. Here hyphen is representing number of spaces. So you can see in first row total number of spaces are four and one S to risk we have to display. Then in second row three spaces and two S to risk then two spaces three S to risk then one space for S to risk then zero space and five S to risk. It means space loop will repeat four, three, two, one and zero times and S to risk loop will repeat one, two, three, four and five times. So now I am going to implement a code for you. Here you can see using printf scanf I am asking number of rows from user. Then first time implementing I loop which will repeat and times. So this loop is responsible for printing number of rows which are required by the user. Then first I have to print the spaces and then S to risk. So this time I am implementing one more loop J and its condition is J less than equals to I sorry N minus I and then J plus plus inside this loop I will be printing space. So now we have to check this. Suppose value of N is five. So this loop is starting from one. I is one first time. So five minus one here value will become four. So this loop is starting from one and condition is J less than equals to four. So this loop will repeat four times. So four spaces will be displayed and our requirement is also four spaces. So four spaces will be printed properly. Now after this loop, I have to implement one more loop to print asterisk. So this loop I am repeating I times because it is dependent upon the number of row which we are printing inside this loop. I am printing asterisk sign after completion of this for loop. I am printing new line so that each room will be displayed in separate lines. So this way I have implemented all all these instructions. So these loops, these two loops are independent. So J loop is not dependent on K and K is not dependent on J. So for I, J and K both are nested loops. But J and K will work independently. J is repeating first time four times then it will repeat three times then two times then one time and K loop first time it will repeat one time then two times then three times then four and then five. So now I am executing this code. Sorry, I have not declared K here. I am entering five. You can see the output. It is displaying the pattern which which is required here. So it is printing this pattern without any hyphen. So I have used this hyphen for your understanding purpose. This hyphen is basically representing number of spaces. So you can see the required pattern is printed on console with the help of this C program. I hope you have understood how you can implement the pattern with the help of these loops in C programming. If you want to watch more programming related videos, you can follow my YouTube channel through this link that is youtube.com slash sanjay gupta underscore tech school. Thank you for watching this video.