Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
C_141127_MatricesSUMA
//Title of this code #include <stdio.h> #include <stdlib.h> #include <time.h> #define _F 3 #define _C 4 int main(void) { long m1[_F][_C]; long m2[_F][_C]; long suma[_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++) { suma[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", suma[f][c]); } printf("\n"); } return 0; }
run
|
edit
|
history
|
help
0
Lior Yehieli Lesson
first C code
C_141106_Divisores
ayudantia ejercicio 2 numero nashee
Assignment 7
18BCE2182 ASSESS_2 Q3
Assignment 4
Goodone for understanding array passing
lab 11 v0.7
Michael Bean's Spring 2017 Lab 3 v1