0

Generate Matrix 2*2

how to generate matrix of 2*2 in c programming.. using arrays #include<stdio.h> int printarray(int a[][3]); int main() { int array[2][2]={{1,2},{4,5}}; printf("Value in array by row are "); printarray(array); } int printarray(int a[][3]) { int i; int j; for(i=0;i<=1;i++){ for(j=0;j<=2;j++){ printf("%d ",a[i][j]); } printf("\n"); } }

25th May 2018, 11:05 AM
Jordan
Jordan  - avatar
3 ответов
+ 3
A random matrix? Just fill each element with a random number.
25th May 2018, 11:10 AM
J.G.
J.G. - avatar
0
yes random numbers
25th May 2018, 11:15 AM
Jordan
Jordan  - avatar
0
how to generate
25th May 2018, 4:22 PM
Jordan
Jordan  - avatar