 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how you can print 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 Techimace that is available on Google Play. Now coming on to the topic. For printing this pattern, first we have to understand how these spaces will be printed and how these digits will be printed. So here you can see I am typing hyphen and some digits. So I am typing hyphen so that we can understand how many spaces are required to print this pattern. So in first row, four spaces are required and one digit. Then in second row, three spaces, two digits. In third row, two spaces and three digits. In fourth row, one space, four digits. And in last row, zero space and five digits. So one loop is required to print space in each row and one loop is required to print digits in each row. And another third loop will be required to control both the loops so that we can identify in which row spaces and digits are printed. So now you can see this code here and is received from user as number of rows. Then first loop which is starting from one and it will repeat n times, which is controlling row numbering. Then the second loop is responsible for printing space. It is repeating n minus i times. So suppose n is five and I will provide one first time. So it will repeat four times. Five minus one is four. Then control will be transferred to this K loop. K will repeat only one time and here if condition is available. So analyze this pattern here at odd positions one is available and even positions zero is available. Like you can see fifth row one zero one so odd positions are printing one and even positions are printing zero. So here I am checking the value of K. If it is odd, then zero will be printed and if it is even then zero sorry if it is odd, then one will be printed and if it is even then zero will be printed. When suppose value of five is five. Fifth time value of five will be five. So five minus five zero spaces will be printed and K will repeat five times. So first time K will K will be one. So this condition will be false. So it will print one. Then K plus plus K will become two. So when K will be two two modulus two the result will be equals to zero. So it will print zero. So this way if K is odd then one will be printed. If K is even then zero will be printed. Now I am executing this code. You can see the output and you can compare it with this pattern. Both are same. So friends, I hope you have understood how you can print this pattern with the help of this code which I have demonstrated you in C programming. If you want to watch more programming related videos then you can follow this link youtube.com slash sanjay gupta underscore tax school. Thank you for watching this video.