 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how you can display this pattern on console using C programming. Before starting, you can look 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 tech image that is available on Google Play. Now coming on to the topic, first we have to analyze this pattern how it will be displayed on console. So you can see first we have to print some space and then digits. So here three loops will be required, one for counting row number, second for printing space and third for printing digits. So here we have to identify how much space is required. So I am representing this pattern like this. Here you can see I have mentioned high fun in place of space and then digits. So now I am going to identify number of spaces and digits. So here number of spaces are four and digits one then number of spaces are three digits are two then number of spaces are two digits are three then number of spaces are one and digits are four then spaces zero and digits five. So now you have identified how many times loop will be repeating to print space and digits. So when first row will be displayed four spaces and one digits will be required. So space loop will repeat four times and digits loop will repeat one time. Then for second row space loop will repeat three times and digits loop will repeat two times and so on. So now I am going to implement code for this pattern. You can see here three variables I, J and N are declared. K is also required because I will be implementing three loops. Then printer will print enter how many rows you want to print this message on console and number of rows will be stored inside N variable. Then for counting row number I am implementing first loop which will repeat N times. Inside this loop first I am implementing loop for printing spaces. So I am starting it from one and its condition is J less than equals to N minus I then J plus plus. This loop will print spaces on console. Now understand it. Suppose value of N is five. We want to print five rows. So initially I will be one then control will be transferred to J loop J is starting from one and here condition is N minus I. So N is five and I is one. So five minus one will be four. So this loop will repeat four times and that is the requirement of our code that first time four spaces should be printed. Then I have to implement one more loop which will repeat one time. So after this J loop I am implementing one more loop. It is starting from one. Its condition is I less sorry K less than equals to I and then K plus plus. Inside this loop with percent D I am printing value of I. So you can see initially first time value of I is one. So this K loop will repeat one and I am printing value of I which is also one. Then this loop will be terminated and I am printing slash N for new line. After printing new line control will be transferred to first loop I plus plus. So this time I will become two. Condition is true. Now control will be transferred to J loop. So this time N is five and I is two. So five minus two is three. So this J loop will repeat three times. So three spaces will be displayed through this J loop. Then control will be transferred to K loop. Here value of I is two. So K loop will repeat two times and two times value of I will be displayed on console. So currently I is two. So two times two will be displayed. Then again new line will be displayed. So this way the pattern will be displayed on console. Now I am executing this code. I am entering five. You can see the output. You can compare it with this pattern which is available initially with us. So both the outputs are same one which is printed through code and one it's one which is typed in notepad. So I hope you have understood how I have printed this pattern with the help of C program. If you want to watch more programming related videos you can follow my link that is youtube.com slash sanjay gupta underscore tax school. Subscribe this YouTube channel. Thank you for watching this video.