logo

Multiplicação de matrizes em C

Multiplicação da matriz em C: Podemos adicionar, subtrair, multiplicar e dividir 2 matrizes. Para fazer isso, estamos recebendo informações do usuário para o número da linha, número da coluna, primeiros elementos da matriz e segundos elementos da matriz. Em seguida, estamos realizando a multiplicação nas matrizes inseridas pelo usuário.

python __nome__

Na multiplicação de matrizes primeira matriz, um elemento da linha é multiplicado pela segunda matriz, todos os elementos da coluna .

Vamos tentar entender a multiplicação de matrizes de 2*2 e 3*3 matrizes pela figura abaixo:

atualizar do join sql
programa de multiplicação de matrizes em c

Vamos ver o programa de multiplicação de matrizes em C.

 #include #include int main(){ int a[10][10],b[10][10],mul[10][10],r,c,i,j,k; system('cls'); printf('enter the number of row='); scanf('%d',&r); printf('enter the number of column='); scanf('%d',&c); printf('enter the first matrix element=
&apos;); for(i=0;i<r;i++) { for(j="0;j&lt;c;j++)" scanf('%d',&a[i][j]); } printf('enter the second matrix element="
&apos;);" for(i="0;i&lt;r;i++)" scanf('%d',&b[i][j]); printf('multiply of mul[i][j]="0;" for(k="0;k&lt;c;k++)" mul[i][j]+="a[i][k]*b[k][j];" for printing result printf('%d	',mul[i][j]); printf('
'); return 0; < pre> <p> <strong>Output:</strong> </p> <pre> enter the number of row=3 enter the number of column=3 enter the first matrix element= 1 1 1 2 2 2 3 3 3 enter the second matrix element= 1 1 1 2 2 2 3 3 3 multiply of the matrix= 6 6 6 12 12 12 18 18 18 </pre> <p>Let&apos;s try to understand the matrix multiplication of <strong>3*3 and 3*3</strong> matrices by the figure given below:</p> <img src="//techcodeview.com/img/c-programs/01/matrix-multiplication-c-2.webp" alt="matrix multiplication in c"> <hr></r;i++)>

Vamos tentar entender a multiplicação de matrizes de 3*3 e 3*3 matrizes pela figura abaixo:

multiplicação de matrizes em c