 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how you can print this pattern in C programming. Before starting, you can note my information. You can follow or subscribe my YouTube channel by following this link that is youtube.com slash sanjaygupta underscore tech school. You can download my Android app that is TechMS which is based on programming available on Google Play. Now coming on to the topic. To display this pattern, I have implemented a code where stdr.h header file is included. Inside main three variables i, j and n are declared. Print f will display this message, enter how many rows you want to print on console. Number of rows will be received by n. Now, first I am implementing i loop which will be displaying number of rows. So it is repeating n times. Inside this loop, I am implementing another loop which is also starting from one, but it will repeat i times. So it is starting from one and it will end to i. So it depends upon value of i. Now, if you carefully focus on this pattern, you can see in first, third and fifth rows, digits are starting from one and in second and fourth row, digits are starting from zero. While first, third and fifth row are printing. First digit is one, then second is zero, then one, then zero. And in second and fourth row, first digit is zero, second is one, then zero, and then one. So here first I have to check this if condition that is based on i. i modulus two double equals to zero. So I am implementing its true and false case. So if this condition is true, if i is divisible by two, that means i is representing even rows like two and four. So in that case, I have to print this row and this row. So here, digits will be starting from zero. So it means odd position will be printing zero and even positions will be printing one. So inside this if condition, I am using another if, which will check j modulus two double equals to zero. So here, if j is divisible by two, j is completely divisible by two, it means it is representing even position. So in second row at even position, we have to print one and at odd position, we have to print zero. So if this j is true, then I will print one and in else case, I will print zero. So this if true case is for printing even rows like this zero one or zero one, zero one. Now to print odd rows, you can see here, digits are starting from one, then zero and then one. So it means again, we have to check the value of j if it is completely divisible by two, then we have to print zero and otherwise one. So now I can copy this if else and I am pasting it here. So you can see both this if condition and this if condition both are same, but here first I have to print zero and then one. And after completion of j loop, I have to print new line. Now this is the complete code. So again, you can see this for loop is containing this if else for printing even rows and this else part for printing odd rows. So now I am executing this code. I'm entering number of rows as five. You can see the output. Odd rows are starting from one and even rows are starting from zero and internally odd rows are printing one, one, zero, one, zero, one, zero, one and even rows are printing zero, one and zero, one, zero, one. So friends, this way you can implement the above mentioned pattern in C programming with the help of nested loop. I hope you have understood how I have implemented this code with the help of C programming. If you want to watch more programming related videos, you can follow my YouTube link that is youtube.com slash sanjaygupta underscore tech school. Thank you for watching this video.