 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how you can display this pattern using 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 Android app that's Techimus which is based on programming available at Google Play. Now coming on to the topic, first we have to understand how this pattern will be displayed on console because first we have to print space and then digits. So I am writing it like this. You can see I am replacing space with hyphen. So this hyphen is for understanding purpose. It will not display on console at console output will be printed like this digits with spaces. So now if we identify spaces and number of digits so you will count in first row four spaces and one digit is printing in second row three spaces and two digits are printing then in third row two spaces and three digits are printing fourth row one space and four digits then in fifth row zero spaces sorry zero space and five digits. So this way to print space we require these number of repetitions and for printing digits we require these number of repetitions. So if we are printing first row then a loop will be required which will print spaces four times and another loop which will print digit one time then in second row space loop will repeat three times and digits loop will repeat two times and this way all the loops will be printing spaces and digits now to control these two loops one for space and one for digit we require third loop which will be controlling which number you which number of row you are printing. So this way total three loops are required to print this pattern now I am going to implement the code here I am implementing first loop that will be responsible for identifying number of rows so this loop will identify which row we are printing now for printing spaces I am implementing second loop which is j and inside this loop I will print spaces so now you have to identify that for first row this space loop must be repeated repeated four times so now let's check it suppose value of n is five which is received through scanf as number of rows so i loop will begin from one condition is true control will be transferred to j loop so j is starting from one now check this condition I have subtracted n minus i so n is five always and i is one this time so five minus one is four so this loop will repeat four times and that that that is the requirement of our logic that in in case of printing first row space loop will be repeating four times now after this loop I am implementing another loop that is k which is starting from one it is repeating i times inside this loop I am printing k and after termination of this loop slash n will be displayed so here value of k will be displayed so first time i is one so this loop will repeat one time and that is the requirement of our logic digits loop will repeat one time only after termination of this loop new line will be displayed second time i will be increased so this i will become two then control will be transferred to this j loop which is printing spaces so this time n minus i so n is five i is two so n minus i means five minus two so it will be three so this j loop will repeat three times now and k loop will repeat two times because i is two and k will be displayed here so first time k will print one and then it will print two so this way the above mentioned loop will be displayed sorry above mentioned pattern will be displayed on console so this third loop is for printing digits now i am executing this code i am entering five as number of rows you can see the output and you can compare it with this pattern both are same so this way i have printed the required pattern with the help of c program here three loops are required first for printing row number or rows second for printing spaces in a particular row and third for printing digits in a particular row and that particular row is provided by the i loop so i hope you have understood how you can print the pattern using c programming and nested loops 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