Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
B_141128_MatrizProducto
//Title of this code #include <stdio.h> #include <stdlib.h> #include <time.h> #define _FA 12 #define _CA 8 #define _FB _CA #define _CB 9 #define _FP _FA #define _CP _CB int main(void) { long a[_FA][_CA]; long b[_FB][_CB]; long p[_FP][_CP]; short f, c, k; for(srand(time(NULL)) , f = 0 ; f < _FA ; f++) { for(c = 0 ; c < _CA ; c++) { a[f][c] = rand() % 10; } } for(f = 0 ; f < _FB ; f++) { for(c = 0 ; c < _CB ; c++) { b[f][c] = rand() % 10; } } for(f = 0 ; f < _FP ; f++) { for(c = 0 ; c < _CP ; c++) { p[f][c] = 0; for(k = 0 ; k < _CA ; k++) { p[f][c] += a[f][k] * b[k][c]; } } } for(f = 0 ; f < _FA ; f++) { for(c = 0 ; c < _CA ; c++) { printf("%3ld", a[f][c]); } printf("\n"); } printf("\n\n\n"); for(f = 0 ; f < _FB ; f++) { for(c = 0 ; c < _CB ; c++) { printf("%3ld", b[f][c]); } printf("\n"); } printf("\n\n\n"); for(f = 0 ; f < _FP ; f++) { for(c = 0 ; c < _CP ; c++) { printf("%5ld", p[f][c]); } printf("\n"); } printf("\n\n\n"); return 0; }
run
|
edit
|
history
|
help
0
Test1
Exploiting uninitialized variable
13
Class #2, data types
coding!!Woo!!
Replacing Evens and Odd with ones and zeroes in a 3-Dimensional array
Test 4
time clock and day count through seconds by ratneshgujarathi
palindrome.c
A.c