Wap To Create Two Matrices. Add The Values Of The Two Matrices.
#include<stdio.h>
#include<conio.h> void main() { int a[2][3],b[2][3],c[2][3],i,j; clrscr(); printf("\n enter values for matrix A:\n"); for(i=0;i<2;i++) for(j=0;j<3;j++) scanf("%d",&a[i][j]); printf("\n enter the values for matrix b:\n"); for(i=0;i<2;i++) for(j=0;j<3;j++) scanf("%d",&b[i][j]); //addition of program for(i=0;i<2;i++) for(j=0;j<3;j++) c[i][j]=a[i][j]+b[i][j]; //print the values of matrix c Are :\n for(i=0;i<2;i++) { for(j=0;j<3;j++) printf("%5d",c[i][j]); printf("\n"); } getch(); } |