

{"id":123302,"date":"2024-02-15T18:00:40","date_gmt":"2024-02-15T12:30:40","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=123302"},"modified":"2024-02-15T18:38:00","modified_gmt":"2024-02-15T13:08:00","slug":"matrix-multiplication-in-c","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/matrix-multiplication-in-c\/","title":{"rendered":"Matrix Multiplication in C"},"content":{"rendered":"<p>Matrix multiplication is a crucial operation in linear algebra and has widespread applications in fields like machine learning, computer graphics, physics simulations, and more.<\/p>\n<p>The aim of this article is to explain matrix multiplication in detail and provide step-by-step code examples for implementing it in the C programming language.<\/p>\n<h2>Understanding Matrices<\/h2>\n<p>An organised collection of numbers or functions in a rectangular shape is referred to as a matrix and normally has m rows and n columns. It is important to remember while talking about matrix multiplication that the number of columns in the first matrix must equal the number of rows in the second matrix in order for the two matrices to be multiplied together. The number of rows from the first matrix and the number of columns from the second matrix will define the dimensions of the final product matrix.<\/p>\n<p>Calculating the total of the products obtained by multiplying the corresponding components from the rows and columns of the first and second matrices is known as matrix multiplication. Simply said, each element in the final product matrix is created by taking the dot product of the first row of the first matrix and the first column of the second matrix.<\/p>\n<h3>Let&#8217;s have two 3&#215;3 matrices:<\/h3>\n<p>A = [1 2 3]<br \/>\n[4 5 6]<br \/>\n[7 8 9]<\/p>\n<p>B = [9 8 7]<br \/>\n[6 5 4]<br \/>\n[3 2 1]<\/p>\n<h3>To multiply these two matrices:<\/h3>\n<p>The number of columns in the first matrix (A) must equal the number of rows in the second matrix (B). Here, A has 3 columns, and B has 3 rows, so we can multiply them.<\/p>\n<p>To find the element C11, we take the dot product of the first row of A with the first column of B: C11 = A11B11 + A12B21 + A13B31 C11 = 19 + 26 + 33 = 36<\/p>\n<p>To find the element C12, we take the dot product of the first row of A with the second column of B: C12 = A11B12 + A12B22 + A13B32 C12 = 18 + 25 + 32 = 25<\/p>\n<p>We follow this pattern and take dot products of each row of A with each column of B to populate the entire matrix C.<\/p>\n<p>C = [36 25 14]<br \/>\n[81 69 57]<br \/>\n[126 113 100]<\/p>\n<p>So, in summary, we take dot products of the rows of A with the columns of B to calculate each element of C. The matrices must have compatible dimensions, with the number of A columns equaling the number of B rows.<\/p>\n<h3>Algorithm for Multiplication of Matrix in C<\/h3>\n<p>When multiplying matrices, each element of the first matrix is multiplied by the corresponding row of the second matrix.<\/p>\n<h4>Let&#8217;s examine the sequential algorithm:<\/h4>\n<ul>\n<li>Input the dimensions (number of rows and columns) of the two matrices to be multiplied. Let the first matrix be A[m][n] and the second matrix be B[p][q].<\/li>\n<li>Allocate memory for the two input matrices, A and B, as per their dimensions.<\/li>\n<li>Input elements into A and B row-wise using nested loops.<\/li>\n<li>Verify that the number of rows in B equals the number of columns in A. If not, give a message of error and leave.<\/li>\n<li>Declare a result matrix C of size m x q to store the product.<\/li>\n<li>Initialize a loop from i = 0 to i = m.<\/li>\n<li>Inside this loop, initialize another loop from j = 0 to j = q.<\/li>\n<li>Set C[i][j] to 0<\/li>\n<li>Inside the ij loop, initialize another loop k = 0 to k = p.<\/li>\n<li>Update C[i][j] by adding the product of A[i][k] * B[k][j].<\/li>\n<li>Print the result matrix C.<\/li>\n<\/ul>\n<h4>Here is the pseudocode implementation:<\/h4>\n<p>1. Input m, n, p, q<br \/>\n2. Allocate A[m][n], B[p][q], C[m][q]<br \/>\n3. Read A and B<br \/>\n4. If n != p<br \/>\nPrint &#8220;Multiplication not possible&#8221;<br \/>\nExit<br \/>\n5. For i = 0 to m<br \/>\nFor j = 0 to q<br \/>\nC[i][j] = 0<br \/>\nFor k = 0 to p<br \/>\nC[i][j] += A[i][k] * B[k][j]<br \/>\n6. Print C<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/12\/Algorithm-for-Multiplication-of-Matrix0A.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-131671 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/12\/Algorithm-for-Multiplication-of-Matrix0A.webp\" alt=\"Algorithm for Multiplication of Matrix\" width=\"400\" height=\"518\" \/><\/a><\/p>\n<h3>Implementing Matrix Multiplication in C<\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include &lt;stdio.h&gt;\r\n\r\n\/\/ Function to perform matrix multiplication\r\nvoid matrixMultiply(int m, int n, int p, int A[][n], int B[][p], int C[][p]) {\r\n    for (int i = 0; i &lt; m; i++) {\r\n        for (int j = 0; j &lt; p; j++) {\r\n            C[i][j] = 0;\r\n            for (int k = 0; k &lt; n; k++) {\r\n                C[i][j] += A[i][k] * B[k][j];\r\n            }\r\n        }\r\n    }\r\n}\r\n\r\n\/\/ Function to print a matrix\r\nvoid printMatrix(int rows, int cols, int mat[][cols]) {\r\n    for (int i = 0; i &lt; rows; i++) {\r\n        for (int j = 0; j &lt; cols; j++) {\r\n            printf(\"%d\\t\", mat[i][j]);\r\n        }\r\n        printf(\"\\n\");\r\n    }\r\n}\r\n\r\nint main() {\r\n    int m = 3, n = 3, p = 3;\r\n    int A[][3] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};\r\n    int B[][3] = {{9, 8, 7}, {6, 5, 4}, {3, 2, 1}};\r\n    int C[3][3];\r\n\r\n    \/\/ Perform matrix multiplication\r\n    matrixMultiply(m, n, p, A, B, C);\r\n\r\n    printf(\"Matrix A:\\n\");\r\n    printMatrix(m, n, A);\r\n\r\n    printf(\"\\nMatrix B:\\n\");\r\n    printMatrix(n, p, B);\r\n\r\n    printf(\"\\nMatrix C (Result of A * B):\\n\");\r\n    printMatrix(m, p, C);\r\n\r\n    return 0;\r\n}<\/pre>\n<p><strong>Time Complexity:<\/strong> O(m * n * p)<br \/>\n<strong>Space Complexity:<\/strong> O(m * p)<\/p>\n<ul>\n<li>&#8220;m&#8221; is the number of rows in the first matrix.<\/li>\n<li>&#8220;n&#8221; is the number of columns in the first matrix (and also the number of rows in the second matrix).<\/li>\n<li>&#8220;p&#8221; is the number of columns in the second matrix.<\/li>\n<\/ul>\n<p><strong>Output:<\/strong><\/p>\n<p><strong>Matrix A:<\/strong><br \/>\n1 2 3<br \/>\n4 5 6<br \/>\n7 8 9<\/p>\n<p><strong>Matrix B:<\/strong><br \/>\n9 8 7<br \/>\n6 5 4<br \/>\n3 2 1<\/p>\n<p><strong>Matrix C (Result of A * B):<\/strong><br \/>\n30 20 10<br \/>\n84 56 28<br \/>\n138 92 46<\/p>\n<h3>Multiplying Matrices in C<\/h3>\n<p><strong>There are two primary types of matrices in mathematics:<\/strong> square matrices and rectangular matrices.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/Multiplying-Matrices-in-C.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-130741 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/Multiplying-Matrices-in-C.webp\" alt=\"Multiplying Matrices in C\" width=\"400\" height=\"210\" \/><\/a><\/p>\n<p>Let&#8217;s begin by discussing the multiplication of square matrices.<\/p>\n<h4>Multiplying Square Matrices<\/h4>\n<p>A square matrix is one where the number of rows is equal to the number of columns. To multiply two square matrices of the same order, they must have the same dimensions. The multiplication process involves multiplying corresponding elements and summing up the products.<\/p>\n<p><strong>Here is a C program to calculate the product of two square matrices:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include &lt;stdio.h&gt;\r\n\r\nint main() {\r\n    int a[10][10], b[10][10], c[10][10], n, i, j, k;\r\n\r\n    printf(\"Enter the size of N (N &lt;= 10): \");\r\n    scanf(\"%d\", &amp;n);\r\n    printf(\"Enter the elements of Matrix-A:\\n\");\r\n\r\n    for (i = 0; i &lt; n; i++) {\r\n        for (j = 0; j &lt; n; j++) {\r\n            scanf(\"%d\", &amp;a[i][j]);\r\n        }\r\n    }\r\n\r\n    printf(\"Enter the elements of Matrix-B:\\n\");\r\n\r\n    for (i = 0; i &lt; n; i++) {\r\n        for (j = 0; j &lt; n; j++) {\r\n            scanf(\"%d\", &amp;b[i][j]);\r\n        }\r\n    }\r\n\r\n    for (i = 0; i &lt; n; i++) {\r\n        for (j = 0; j &lt; n; j++) {\r\n            c[i][j] = 0;\r\n            for (k = 0; k &lt; n; k++) {\r\n                c[i][j] += a[i][k] * b[k][j];\r\n            }\r\n        }\r\n    }\r\n\r\n    printf(\"The product of the two matrices is:\\n\");\r\n    for (i = 0; i &lt; n; i++) {\r\n        for (j = 0; j &lt; n; j++) {\r\n            printf(\"%d\\t\", c[i][j]);\r\n        }\r\n        printf(\"\\n\");\r\n    }\r\n    return 0;\r\n}<\/pre>\n<p>In the program above, we ask the user to enter the matrix size (N) once because only matrices of the same order can be multiplied.<\/p>\n<p><strong>Input:<\/strong><br \/>\n<strong>Enter the value of N (N &lt;= 10):<\/strong> 2<br \/>\n<strong>Enter the elements of Matrix-A:<\/strong><br \/>\n2 2<br \/>\n2 2<br \/>\n<strong>Enter the elements of Matrix-B:<\/strong><br \/>\n2 2<br \/>\n2 2<\/p>\n<p><strong>Output:<\/strong><br \/>\n<strong>The product of the two matrices is:<\/strong><br \/>\n8 8<br \/>\n8 8<\/p>\n<h4>Multiplying Rectangular Matrices<\/h4>\n<p>There are several combinations of rows and columns in rectangular matrices. The number of columns in the first matrix must equal the number of rows in the second matrix in order to multiply two rectangular matrices.<\/p>\n<p><strong>Here is a C program to calculate the product of two rectangular matrices:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include &lt;stdio.h&gt;\r\n\r\nint main() {\r\n    int m, n, p, q, i, j, k;\r\n    int a[10][10], b[10][10], res[10][10];\r\n\r\n    printf(\"Enter the dimensions of the first matrix:\\n\");\r\n    scanf(\"%d%d\", &amp;m, &amp;n);\r\n    printf(\"Enter the dimensions of the second matrix:\\n\");\r\n    scanf(\"%d%d\", &amp;p, &amp;q);\r\n\r\n    if (n != p) {\r\n        printf(\"Matrix is incompatible for multiplication\\n\");\r\n    } else {\r\n        printf(\"Enter the elements of Matrix-A:\\n\");\r\n        for (i = 0; i &lt; m; i++) {\r\n            for (j = 0; j &lt; n; j++) {\r\n                scanf(\"%d\", &amp;a[i][j]);\r\n            }\r\n        }\r\n\r\n        printf(\"Enter the elements of Matrix-B:\\n\");\r\n        for (i = 0; i &lt; p; i++) {\r\n            for (j = 0; j &lt; q; j++) {\r\n                scanf(\"%d\", &amp;b[i][j]);\r\n            }\r\n        }\r\n\r\n        for (i = 0; i &lt; m; i++) {\r\n            for (j = 0; j &lt; q; j++) {\r\n                res[i][j] = 0;\r\n                for (k = 0; k &lt; p; k++) {\r\n                    res[i][j] += a[i][k] * b[k][j];\r\n                }\r\n            }\r\n        }\r\n\r\n        printf(\"The product of the two matrices is:\\n\");\r\n\r\n        for (i = 0; i &lt; m; i++) {\r\n            for (j = 0; j &lt; q; j++) {\r\n                printf(\"%d\\t\", res[i][j]);\r\n            }\r\n            printf(\"\\n\");\r\n        }\r\n    }\r\n\r\n    return 0;\r\n}<\/pre>\n<p>In this program, we ensure that the dimensions of the matrices are compatible with multiplication before performing the calculation.<\/p>\n<p><strong>Input:<\/strong><br \/>\n<strong>Enter the order of the first matrix:<\/strong><br \/>\n2 3<br \/>\n<strong>Enter the order of the second matrix:<\/strong><br \/>\n3 2<br \/>\n<strong>Enter the elements of Matrix-A:<\/strong><br \/>\n1 2<br \/>\n1 2<br \/>\n1 2<br \/>\n<strong>Enter the elements of Matrix-B:<\/strong><br \/>\n1 2<br \/>\n3 2<\/p>\n<p><strong>Output:<\/strong><br \/>\n<strong>The product of the two matrices is:<\/strong><br \/>\n7 6<br \/>\n7 6<\/p>\n<h3>Matrix Multiplication in C Using Functions<\/h3>\n<p>In the realm of matrix multiplication in C, we encounter scenarios where we need to multiply matrices repeatedly. However, rewriting the same code for each multiplication can lead to a larger, more complex program and make debugging a daunting task. To overcome this challenge, we can harness the power of functions.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include &lt;stdio.h&gt;\r\n\r\n\/\/ Function to input matrix elements entered by the user\r\nvoid userInputMatrix(int inputMatrix[][10], int rows, int columns) {\r\n    printf(\"\\nEnter matrix elements:\\n\");\r\n    for (int i = 0; i &lt; rows; ++i) {\r\n        for (int j = 0; j &lt; columns; ++j) {\r\n            printf(\"Please enter an element for row %d, column %d: \", i + 1, j + 1);\r\n            scanf(\"%d\", &amp;inputMatrix[i][j]);\r\n        }\r\n    }\r\n}\r\n\r\n\/\/ Function to multiply two matrices\r\nvoid multiplyTwoMatrices(int firstMatrix[][10], int secondMatrix[][10], int resultMatrix[][10], int r1, int c1, int r2, int c2) {\r\n    \/\/ Initializing elements of the result matrix to 0.\r\n    for (int i = 0; i &lt; r1; ++i) {\r\n        for (int j = 0; j &lt; c2; ++j) {\r\n            resultMatrix[i][j] = 0;\r\n        }\r\n    }\r\n\r\n    \/\/ Multiplying the first and second matrices and storing the result in the result matrix\r\n    for (int i = 0; i &lt; r1; ++i) {\r\n        for (int j = 0; j &lt; c2; ++j) {\r\n            for (int k = 0; k &lt; c1; ++k) {\r\n                resultMatrix[i][j] += firstMatrix[i][k] * secondMatrix[k][j];\r\n            }\r\n        }\r\n    }\r\n}\r\n\r\n\/\/ Function to display the result matrix\r\nvoid displayResultMatrix(int resultMatrix[][10], int rows, int columns) {\r\n    printf(\"\\nResult Matrix:\\n\");\r\n    for (int i = 0; i &lt; rows; ++i) {\r\n        for (int j = 0; j &lt; columns; ++j) {\r\n            printf(\"%d  \", resultMatrix[i][j]);\r\n            if (j == columns - 1) {\r\n                printf(\"\\n\");\r\n            }\r\n        }\r\n    }\r\n}\r\n\r\nint main() {\r\n    int matrixA[10][10], matrixB[10][10], resultMatrix[10][10], rowsA, columnsA, rowsB, columnsB;\r\n\r\n    printf(\"Please provide the number of rows and columns for the first matrix: \");\r\n    scanf(\"%d %d\", &amp;rowsA, &amp;columnsA);\r\n\r\n    printf(\"Please provide the number of rows and columns for the second matrix: \");\r\n    scanf(\"%d %d\", &amp;rowsB, &amp;columnsB);\r\n\r\n    while (columnsA != rowsB) {\r\n        printf(\"The number of columns in the first matrix must be equal to the number of rows in the second matrix.\\n\");\r\n        printf(\"Please re-enter the number of rows and columns for the first matrix: \");\r\n        scanf(\"%d %d\", &amp;rowsA, &amp;columnsA);\r\n\r\n        printf(\"Please re-enter the number of rows and columns for the second matrix: \");\r\n        scanf(\"%d %d\", &amp;rowsB, &amp;columnsB);\r\n    }\r\n\r\n    \/\/ Input elements of the first matrix\r\n    userInputMatrix(matrixA, rowsA, columnsA);\r\n\r\n    \/\/ Input elements of the second matrix\r\n    userInputMatrix(matrixB, rowsB, columnsB);\r\n\r\n    \/\/ Multiply two matrices\r\n    multiplyTwoMatrices(matrixA, matrixB, resultMatrix, rowsA, columnsA, rowsB, columnsB);\r\n\r\n    \/\/ Display the result matrix\r\n    displayResultMatrix(resultMatrix, rowsA, columnsB);\r\n\r\n    return 0;\r\n}<\/pre>\n<p>By employing these functions, you can streamline your code, enhance readability, and efficiently perform matrix multiplication as needed within your program.<\/p>\n<h3>Real-World Applications<\/h3>\n<p><strong>Some examples of matrix multiplication in action:<\/strong><\/p>\n<ul>\n<li><strong>Computer Graphics:<\/strong> Transformations like rotation, scaling, and translation of images and shapes involve matrix multiplications.<\/li>\n<li><strong>Machine Learning:<\/strong> Matrix multiplication is used in various machine learning algorithms like neural networks.<\/li>\n<li><strong>Physics Engines:<\/strong> Simulating physics for animations and games requires matrix math for 3D rotations and coordinate transformations.<\/li>\n<\/ul>\n<h3>Conclusion<\/h3>\n<p>Matrix multiplication in C is a fundamental linear algebra operation with applications across science and engineering domains. This article provided an overview of matrix multiplication, a step-by-step algorithm, and sample C code to implement it for two matrices. Mastering matrix operations like multiplication in C is essential for fields like graphics, simulation, and data science.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Matrix multiplication is a crucial operation in linear algebra and has widespread applications in fields like machine learning, computer graphics, physics simulations, and more. The aim of this article is to explain matrix multiplication&#46;&#46;&#46;<\/p>\n","protected":false},"author":86671,"featured_media":123876,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19488],"tags":[29540,23914,29133,2263,29962,20197],"class_list":["post-123302","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-c-programming","tag-c-matrix-multiplication","tag-c-programming","tag-c-tutorials","tag-c","tag-matrix-multiplication","tag-matrix-multiplication-in-c"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Matrix Multiplication in C - DataFlair<\/title>\n<meta name=\"description\" content=\"Matrix multiplication in C is a fundamental linear algebra operation with applications across science and engineering domains.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/matrix-multiplication-in-c\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Matrix Multiplication in C - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Matrix multiplication in C is a fundamental linear algebra operation with applications across science and engineering domains.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/matrix-multiplication-in-c\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2024-02-15T12:30:40+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-02-15T13:08:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/matrix-multiplication-in-c.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"TechVidvan Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"TechVidvan Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Matrix Multiplication in C - DataFlair","description":"Matrix multiplication in C is a fundamental linear algebra operation with applications across science and engineering domains.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/matrix-multiplication-in-c\/","og_locale":"en_US","og_type":"article","og_title":"Matrix Multiplication in C - DataFlair","og_description":"Matrix multiplication in C is a fundamental linear algebra operation with applications across science and engineering domains.","og_url":"https:\/\/data-flair.training\/blogs\/matrix-multiplication-in-c\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2024-02-15T12:30:40+00:00","article_modified_time":"2024-02-15T13:08:00+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/matrix-multiplication-in-c.webp","type":"image\/webp"}],"author":"TechVidvan Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"TechVidvan Team","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/matrix-multiplication-in-c\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/matrix-multiplication-in-c\/"},"author":{"name":"TechVidvan Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/0e594f928e31fc96628ac40f6ae74f49"},"headline":"Matrix Multiplication in C","datePublished":"2024-02-15T12:30:40+00:00","dateModified":"2024-02-15T13:08:00+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/matrix-multiplication-in-c\/"},"wordCount":1114,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/matrix-multiplication-in-c\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/matrix-multiplication-in-c.webp","keywords":["c matrix multiplication","c programming","c tutorials","C++","matrix multiplication","Matrix multiplication in C"],"articleSection":["C Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/matrix-multiplication-in-c\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/matrix-multiplication-in-c\/","url":"https:\/\/data-flair.training\/blogs\/matrix-multiplication-in-c\/","name":"Matrix Multiplication in C - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/matrix-multiplication-in-c\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/matrix-multiplication-in-c\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/matrix-multiplication-in-c.webp","datePublished":"2024-02-15T12:30:40+00:00","dateModified":"2024-02-15T13:08:00+00:00","description":"Matrix multiplication in C is a fundamental linear algebra operation with applications across science and engineering domains.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/matrix-multiplication-in-c\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/matrix-multiplication-in-c\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/matrix-multiplication-in-c\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/matrix-multiplication-in-c.webp","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/matrix-multiplication-in-c.webp","width":1200,"height":628,"caption":"matrix multiplication in c"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/matrix-multiplication-in-c\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"C Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/c-programming\/"},{"@type":"ListItem","position":3,"name":"Matrix Multiplication in C"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/0e594f928e31fc96628ac40f6ae74f49","name":"TechVidvan Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/c89190da3d4010c71ba476b618ab10fdc2335c82cdfa0ad5002d98d0f2473444?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/c89190da3d4010c71ba476b618ab10fdc2335c82cdfa0ad5002d98d0f2473444?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c89190da3d4010c71ba476b618ab10fdc2335c82cdfa0ad5002d98d0f2473444?s=96&d=mm&r=g","caption":"TechVidvan Team"},"description":"TechVidvan Team provides high-quality content &amp; courses on AI, ML, Data Science, Data Engineering, Data Analytics, programming, Python, DSA, Android, Flutter, full stack web dev, MERN, and many latest technology.","url":"https:\/\/data-flair.training\/blogs\/author\/test001\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/123302","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/86671"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=123302"}],"version-history":[{"count":11,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/123302\/revisions"}],"predecessor-version":[{"id":133819,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/123302\/revisions\/133819"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/123876"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=123302"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=123302"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=123302"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}