Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
A_141128_MatricesSuma
//Title of this code #include <stdio.h> #include <stdlib.h> #include <time.h> #define _F 4 #define _C 5 int main(void) { long m1[_F][_C]; long m2[_F][_C]; long s[_F][_C]; short f, c; for(srand(time(NULL)) , f = 0 ; f < _F ; f++) { for(c = 0 ; c < _C ; c++) { m1[f][c] = rand() % 10; } } for(f = 0 ; f < _F ; f++) { for(c = 0 ; c < _C ; c++) { m2[f][c] = rand() % 10; } } for(f = 0 ; f < _F ; f++) { for(c = 0 ; c < _C ; c++) { s[f][c] = m1[f][c] + m2[f][c]; } } for(f = 0 ; f < _F ; f++) { for(c = 0 ; c < _C ; c++) { printf("%3ld", m1[f][c]); } printf(" "); for(c = 0 ; c < _C ; c++) { printf("%3ld", m2[f][c]); } printf(" "); for(c = 0 ; c < _C ; c++) { printf("%4ld", s[f][c]); } printf("\n"); } return 0; }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
project 5 v.075
20171116:FUNCIONES
22nd HW Switchv0.2
Project 3 Part 1 v1.1
ajr
C dynamic string implementation using preprocessor
FunPointBreakfast
co_1
C_141210_Funciones
C Structs Example
Please log in to post a comment.