 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 note my information, you can follow or subscribe my YouTube channel by opening the 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 on to this pattern, first we have to analyze this pattern because it is printing space and then letters. So I am typing this in this way. You can see I have placed hyphen in place of space and then letters. So we have to count how many spaces are required and then how many letters are required in a particular row. So in first row, number of spaces required are four and letters 1. Then in second row, number of spaces are required 3, letters 2. In third row, number of letters sorry number of spaces are 2 and number of letters required 3. Then in fourth row, space 1, letters 4. In fifth row, space 0 and letters 5. So with this way, one loop will be printing spaces, second loop will be printing letters and third loop will be controlling in which row we are printing spaces and letters. So now I am going to implement the code for you. First I am implementing the loop which will provide the row number in which we have to print spaces and letters. So I have read value of n through printf and scanf. So this first loop is repeating n times. Inside this loop, I am implementing another loop that will repeat n minus i times and inside this loop, I am providing space. So this first loop is responsible for rows and second loop is responsible for spaces. Here suppose value of n is 5 as we want to print 5 rows and i will be one first time. So in j loop, condition will be j less than equals to 5 minus 1 that is 4. So this loop will repeat 4 times and it is the requirement of first row that 4 spaces should be printed. Now after this loop, another loop is required which will start from 1 and it will repeat i times. Inside this loop printf will display percent c comma ch and ch will be incremented by 1. So this loop is repeating i times. So first time i is 1. So it will repeat 1 time then ch will be printed a and then ch will become b. Next time i plus plus i will become 2. Control will be transferred to j loop. So n is 5 and i is 2. So 5 minus 2 is 3. So second time this loop will print 3 spaces. Then control will be transferred to k loop. k is printing letters. So this time value of i is 2. So this loop will repeat 2 times. So first character will be displayed then it will be incremented. Then again character will be displayed and then it will be incremented. So this way the pattern will be displayed on console. After completion of k loop slash n is also required so that rows will be printed in separate lines. Now i am going to execute this code. Sorry, i have not initialized ch with a. That's why this garbage values has been printed on console. Now i am again executing this code. This time you can see the output. You can compare it with the requirement. Both are same. So the required pattern is printed on console. I hope with this example you have understood how you can print the pattern on console. If you want to watch more programming related videos you can follow my youtube channel through the link youtube.com slash sanjay gupta underscore tech school. Thank you for watching this video.