 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how you can print transpose of a matrix by passing 2D array into function. Before starting, you can note my information, you can follow or subscribe my YouTube channel through the URL youtube.com slash sanjaygupta underscore tech school. You can download my programming app, Techimus, which is available on Google Play. Now I am going to implement the solution of this problem with the help of C programming. So first time including a header file that is stdio.h. Now I am declaring a function whose name is print. Its written type is void and it will receive a 2D array as an argument which is of integer type. So this statement is function declaration. Now I am defining main function where I am declaring a 2D array and then two variables i and j. Then with the help of printf, I am going to display the message enter elements on console. Now I am implementing nested loops. These nested loops will read elements from user with the help of scanf. J will be providing row index and J will be providing column indexes and the entered elements will be received through this scanf statement. So this is the reading process from line number 7 to 10. Now I can call print function which will be displaying matrix transpose. So this is function calling statement and after calling I am writing return 0. So I have implemented the complete definition of main function. After that I have to define print function. So print function is receiving an argument that is 2D array of integer type. So this block will be known as function definition. Inside this function definition, I am declaring two variables i and j. Now to print matrix transpose, I am again implementing nested loops. Where i is providing row index and j is providing column indexes. So inside j loop, I am using printf which will display element of a matrix. But here I am using indexes in reverse order like swapped. So normally whenever we print the matrix, we use aj. But here I am using aj because I want to print transpose of matrix. So first I want to approach column of the matrix. So for that purpose I am using aj. So if I write aj, then I am printing first column on the console. After completion of j loop, I can apply slash n. So this way I have implemented the definition of print function which is displaying transpose of the matrix. And instead of aj for printing, I am using aj. Now I am executing this code. Sorry, one more. Currently this is required. So here you can see I am entering the elements. Now you can see the result. I have entered 1, 2, 3, 4, 5, 6, 7, 8, 9 row wise, but it is printing column wise. So the transpose of entered values are printing in front of you, which is the correct notation. If you want to show the message printf slash n, transpose is... So with this message, output will be printed with a caption. Sorry, semicolon is required. So again I am entering the values of matrix. So you can see the result. 1, 2, 3, which is available in row. Now after transpose it is printing in column. Then 4, 5, 6 again converted into column and 7, 8, 9 is also converted into column. So this way I have printed transpose of the entered matrix with the help of function. So I hope you have understood how we can pass a function. Sorry, how we can pass a 2D array into function so that we can print transpose of the matrix. If you want to watch more programming related videos, you can follow or subscribe my YouTube channel through the URL youtube.com slash sanjay gupta underscore tech school. You can download my programming app, Techimus, which is available on Google Play. Thank you for watching this video.