/*
* 1000+ C programs + tutorials
*
*
* 88_c_program_do_display_3x3_matrix.c
*
*
*
* Created on: Oct 25, 2014
* Author: Code2care.org
*/
#include
//#include
void main() {
int arr[3][3];
int i,j;
//clrscr();
printf("3x3 Matrix : ");
//Read the elements of the 3x3 matrix
for(i=0;i<=2;i++) {
for(j=0;j<=2;j++) {
printf("\nEnter element at location %d,%d : ",i+1,j+1);
scanf("%d",&arr[i][j]);
}
}
printf("\n\n 3x3 matrix : \n\n");
//Read the elements of the 3x3 matrix
for(i=0;i<=2;i++) {
for(j=0;j<=2;j++) {
printf("%d ",arr[i][j]);
}
printf("\n");
}
//getch();
}
-
Output :
3x3 Matrix :
Enter element at location 1,1 :
Enter element at location 1,2 :
Enter element at location 1,3 :
Enter element at location 2,1 :
Enter element at location 2,2 :
Enter element at location 2,3 :
Enter element at location 3,1 :
Enter element at location 3,2 :
Enter element at location 3,3 :
3x3 matrix :
1 2 3
4 5 6
7 8 9
The best way to learn C programming is to practice more and more of programs .
Code2care C Programming tutorials provide 1000+ programs in C that you can study and become an expert in the language. Programs are divided into categories depending upon type and complexity.
BSc. IT, BSc. Computer Science, BSc. IT, MSc. IT, MSc. Computer Science, MCA, BTech IT & BTech Engineers may find these programs very useful.