Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
MatrixMul_shortxshort
//gcc 5.4.0 #include <stdio.h> unsigned short a[16][16], b[16][16]; unsigned int c[16][16]; int main(void) { int i, j, k=500; int sum, tmp=16; sum = 0; for (i=0;i<tmp; i++) { for (j=0;j<tmp;j++){ a[i][j] = j+sum; } sum = sum + tmp; } sum=1; for (i=0;i<tmp; i++) { for (j=0;j<tmp;j++){ b[i][j] = (j+sum)*sum; } sum = sum + tmp; } for (i=0;i<tmp;i++){ for (j=0; j<tmp; j++){ for (k=0;k<tmp;k++){ sum = sum + a[i][k] * b[k][j]; } c[i][j] = sum; sum=0; } } printf("Matrix A:\n"); for (i=0;i<tmp; i++) { for (j=0;j<tmp;j++){ printf("%d\t",a[i][j]); } printf("\n"); } printf("Matrix B:\n"); for (i=0;i<tmp; i++) { for (j=0;j<tmp;j++){ printf("%d\t",b[i][j]); } printf("\n"); } printf("\nAxB:\n"); for (i=0;i<tmp; i++) { for (j=0;j<tmp;j++){ printf("%d\t",c[i][j]); } printf("\n"); } return 0; }
run
|
edit
|
history
|
help
0
C_141210_Punteros
Test 3
pattern
ordenarcifrademenosamas
Program to calculate characters
formatting_input_and_output
Operation of two numbers
multi dimension sum
ptr_to_ptr
assignment 3 celina