 Hello friends, I am Sanjay Gupta. In this video I am going to demonstrate you how you can print factorial of each number which is present in a matrix. 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 TechMS 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 I am including a header file stdiv.h. Then inside main function I am declaring a 2D array of dimension 3 by 3 then variable i, j, n and f. Now I am going to display a message using printf on console that is enter elements. To receive elements I am applying nested loops. So first is for for loop which is maintained by i. Second loop is j. So i will be providing row indexes and j will be providing column indexes. Now to read elements I am applying scanf statement which will read all the elements which will read all the elements provided by user and those elements will be stored at different indexes in a matrix that is A. Now for calculation purpose again I am applying nested loops with the help of i and j. Inside this loop that is j I am assigning a of i, j into n. So according to this logic I have to calculate factorial of n. So for that purpose I am assigning 1 into f. Now I am applying another loop k equals to 1, k less than equals to n and then k plus plus. With this loop I am applying the logic f equals to f into k. So this way factorial will be calculated in f variable. After completion of this k loop I can print the calculated result which is available in f on console. So factorial equals to force ind and then f. So this way I have applied the logic which is calculating factorial of each number available in a matrix. So you can see I have implemented 3 loops. Third loop is calculating factorial. And after completion of k loop factorial will be displayed on console with the help of this printf statement. And I am going to declare this k variable and at last I am using return 0. So this way complete code is implemented in front of you which will print factorial of each number present in a matrix. Now I am going to execute this code. So I am entering 5 in whole matrix. You can see the output factorial equals to 20 for each element because factorial of 5 is 120. So this way you can see program is working properly. It is printing factorial of each number which is available in a matrix. I hope you have understood the logic well. If you want to watch more programming related videos you can follow or subscribe my YouTube channel through the URL youtube.com. You can download my programming app Techimace which is available on Google Play. Thank you for watching this video.