 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how you can print diagonally one and remaining locations as blank spaces. Before starting, you can note my information. You can follow or subscribe my YouTube channel by this link youtube.com slash sanjaygupta underscore tech school. You can download my Android app tech image, which is available on Google Play. So this code is implemented in C to print above pattern. Here three variables i, j and n are declared. Print app will display this message on console. The number of rows will be received inside this n variable. Here number of rows are five. You can increase these number of rows by providing input at the time of execution. To print this pattern, first time implementing a loop starting from zero, it will repeat n times. This loop is for providing the row number. Actual values will be displayed with the help of this j loop, which is also repeating n times because number of rows and columns are same. Now I am implementing if condition if I double equals to j. If this condition is true, then I have to print one. Otherwise I have to print blank space. So this is the if condition which will execute as per the rotation of J loop. So if this condition is true, I double equals to j, it means it is representing diagonal position because in case of diagonal, i and j both are pointing to same value. Then one will be displayed. Otherwise space will be displayed after termination of J loop. New line should be displayed on console. So this is the complete code which will display above pattern on console. Now I am executing this code. You can see the output with the help of this code. I am able to print this pattern on console. Now if you want to print zero in place of one diagonally, so you can place zero here. You can see the output zero is printing diagonally and remaining locations are blank. So this way you can print above pattern with the help of C program. I hope you have understood the concept. If you want to watch more programming related videos, you can visit my YouTube channel through youtube.com slash sanjaygupta underscore tech school. Thank you for watching this video.