Array Matrix Sum Program – C Language

#include <stdio.h> #include <stdlib.h> int main() { int a[3][3],b[3][3],c[3][3],i,j; printf(“Enter the first matrix.\n”); for(i=0;i<3;i++){ for(j=0;j<3;j++){ scanf(“%d”,&a[i][j]); } } printf(“Enter the second matrix.\n”); for(i=0;i<3;i++){ for(j=0;j<3;j++){ scanf(“%d”,&b[i][j]); } } printf(“The sum of the matrix.\n”); for(i=0;i<3;i++){ for(j=0;j<3;j++){ c[i][j]=a[i][j]+b[i][j]; printf(“%d\t”,c[i][j]); } printf(“\n”); } return 0; }
Read More

Array Matrix Program – C Language

#include <stdio.h> #include <stdlib.h> int main() { int i,j; int array[3][3]; printf(“Enter the value\n”); for(i=0;i<3;i=i+1){ for(j=0;j<3;j=j+1){ scanf(“%d”,&array[i][j]); } } printf(“The matrix is %d\n”); for(i=0;i<3;i=i+1){ for(j=0;j<3;j=j+1){ printf(“%d\t”,array[i][j]); } printf(“\n”); } return 0; }
Read More

Array Matrix Multiplication Program – C Language

#include <stdio.h> #include <stdlib.h> int main() { int a[3][3],b[3][3],c[3][3],i,j; printf(“Enter the first matrix.\n”); for(i=0;i<3;i++){ for(j=0;j<3;j++){ scanf(“%d”,&a[i][j]); } } printf(“Enter the second matrix.\n”); for(i=0;i<3;i++){ for(j=0;j<3;j++){ scanf(“%d”,&b[i][j]); } } printf(“The product of the matrix.\n”); for(i=0;i<3;i++){ for(j=0;j<3;j++){ c[i][j]=a[i][j]*b[i][j]; printf(“%d\t”,c[i][j]); } printf(“\n”); } return 0; }
Read More