+ 3
How to write a program fot mattrix?
2 Answers
+ 4
To write a program for matrix you need to use two dimensional array...
and access the value of array by using nesting of for loop..
Eg- for 3*3 matrix
int arr[3][3]= {{1,2,3}, {4,5,6}, {7,8,9}};
And you can access it by
int i, j;
for(i=0; i<3; i++){
for(j=0; j<3; j++){
printf("%d", arr[i][j]);
}
}
+ 5
You should use two dimensional array to write program.