 Hello friends, I am Sanjay Gupta. In this video I am going to demonstrate you how you can print transpose of a matrix in C programming. Before starting you can note my information, you can follow or subscribe my youtube channel through the url youtube.com slash sanjaygupta underscore tax school. You can download my programming app Takamis which is available on google play. Now I am going to implement a code in C so that you can understand how we can print transpose of a matrix. So I am including s3dir.h then main function inside main I am declaring 2d array dimension is 3 by 3 and ij then printer will display the message enter elements on console to receive the elements I am implementing nested loops. So first loop I will provide row indexes. Second loop is j which will provide column indexes. These nested loops will repeat scanf to receive elements from user. So this is the reading process. Now I am going to display transpose to print transpose again I am implementing nested loop. So first loop is for row indexes. Now in a loop it will provide column indexes with j loop. I am going to display the element with aji. So normally we print matrix with aij index but I am using aji because if we want to print row index in column format then I have to swap ij with ji because this way first time i will be 0 then j will repeat 3 times. So indexes will be 0 0 1 0 and 2 0. So these indexes are for first column which will be displayed in row wise order. After completion of j loop I have to provide new line. So I am using flash n. So this is the complete implementation of the program. So this way you can print the transpose of the entered matrix on console. Now I am executing this code. You can see the output 1 2 3 which is available in row are printed in column now then 4 5 6 and then 7 8 9. So you can see the transpose of matrix is printed correctly on console. So you just have to change the indexes. For normal matrix printing we use aij but for matrix we have to use aji indexes. Now if you have different indexes like 3 4 so here you have to use 4 at column loop. So while printing transpose here you have to use 4 and here you have to use 3 because rows are 3 and columns are 4. So here when you will be converting row into column so here columns are 4 but rows are 3. So inner loop will be repeating 3 times and outer loop will be repeating 4 times. So now again I am entering the elements. You can see the output 1 2 3 4 which is first row is printed in column 5 6 7 8 again converted into column and 9 10 11 12 is also converted into column. So this way if you have different dimensions then also you can print transpose. If you have same dimension then you can also transpose of the matrix. So this is the complete explanation of the logic. I hope you have understood both the concepts. If you want to watch more programming related videos you can follow or subscribe my YouTube channel through the main URL youtube.com slash sanjay gupta underscore tech school. You can download my programming app Techness which is available on Google Play. Thank you for watching this video.