 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how you can print this pattern on console using C programming. Before starting, you can note my information. You can follow or subscribe my YouTube channel through the link that is youtube.com slash sanjaygupta underscore tech school. You can download my Android app that is Techimage which is available on Google Play. Now coming onto the topic, first we have to analyze this pattern. Here you can see some spaces available and then letters are printed. So I am modifying this pattern by typing this. Here you can see I am replacing all the spaces with hyphen so that you can identify how many spaces are required. So if we count spaces and letters, you will see in first row four spaces and one letter is required. In second row three spaces and two letters are required. In third row two spaces and three letters are required. In fourth row one space and four letters are required. In fifth row zero space and five letters are required. So here we have to implement two loops one for printing space and another for printing letters. In first row sorry to print first row space loop will repeat four times and letter loop will repeat one time. To print second row letter loop will repeat three times and sorry space loop will repeat three times and letters loop will repeat two times and so on. So this way you can implement two separate loops for printing spaces and letters. Now to control these two loops that which row we want to print then third loop is also required which will be controlling these two loops for printing spaces and letters. So first time implementing that loop for I equals to one I less than equals to N and I plus plus. So this is the first loop which will which will tell which row we want to print. So I will be providing the row numbering so initially it is one so value of I is one so it is print it is providing row number one. When I plus plus will be performed so value of I will become two so it will indicate row number two. Now inside this loop I am implementing another loop which will print spaces. So this loop is for printing spaces and it is repeating and minus one time. So here if you identify number of rows so let's say number of rows are five. So in first row five minus one space are required then five minus two five minus three five minus four and five minus five. So five is fixed as N and then it is decremented by one two three four and five. So these one two three four five are row numbers which will be available by I. So here we can write this N minus I so this space loop must be controlled by N minus I condition. You can see here I have used N minus I. So suppose initially N is five through this print f and scan f I am reading number of rows. So suppose N is five so first time I will be one so five minus one that is four. So this loop will repeat four times when I plus plus will be performed value of I will become two. So next time for five minus two so three will be available. So it will print three spaces then again two then one and then zero after printing spaces. I am implementing one more loop that is K starting from one this K loop will repeat I times and here K plus plus is available. So inside this loop I am printing percent C and CH and then I am incrementing value of CH by one. And before starting space loop I am initializing value of CH as a and variable CH is declared above and its data type is care. So you can see this third loop is printing letters and it is a controlled with I here you can see in first row one letter in second row two then three then four and then five letters are required. So if we are working on first row then one letter is required. If we are working on second row then two letters are required and row numbering are provided by I. So this letters loop will be controlled by I variable and you can see it here its condition is K less than equals to I. So K loop is controlled by I after completion of K loop for new line I am using slash N. So this way I have implemented complete code here first row is sorry first loop is controlling row. Second loop is printing space and third loop is printing letters in third loop. CH is continuously incremented after increment its value will change and every time we have to start printing letters from a. So that's why before these loops I have initialized value of CH with a. So every time when K loop will be starting CH will be providing initial value as a. Now I am executing this code you can see the required output is available here as it is available in this notepad file. So you can compare both the patterns both are printing same values. So this way with the help of this C code I have printed the required pattern on console. I hope you have understood how I have implemented this code to print the required pattern. If you want to watch more programming related videos you can open my YouTube channel through the link that is youtube.com slash Sanjay Gupta underscore tech school. Thank you for watching this video.