Skip to content
Snippets Groups Projects
Commit c9c9445c authored by Stanisław Pokora's avatar Stanisław Pokora
Browse files

Upload New File

parent f4584f3e
Branches
No related merge requests found
lab5c.c 0 → 100644
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(){ // dokoncze w domu by dzialalo
int mat1[2][2] = {
{0,0},
{0,0}
}
int mat2[2][2];
printf("Podaj liczby w pierwszej macierzy:");
for(int i = 0;i<2;i++){
for(int j = 0;j<2;j++){
scanf("%i ",&mat1[i][j]);
}
}
printf("\nPodaj liczby w drugiej macierzy:");
for(int i = 0;i<2;i++){
for(int j = 0;j<2;j++){
scanf("%i ",&mat1[i][j]);
}
}
int mat3[2][2];
mat3[0][0] = mat1[0][0]*mat2[0][0]+mat1[0][2]*mat2[1][0];
mat3[0][1] = mat1[0][0]*mat2[0][1]+mat1[0][1]*mat2[1][1];
mat3[1][0] = mat1[1][0]*mat2[0][0]+mat1[1][1]*mat2[1][0];
mat3[1][1] = mat1[1][0]*mat2[0][1]+mat1[1][1]*mat2[1][1];
for(int i = 0;i<2;i++){
for(int j = 0;j<2;j++)
printf("%f ",&mat3[i][j]);
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment