Program 2
Program 2
#include <stdio.h>
#include <conio.h>
int main()
{
int i,j,rows,col;
printf("Enter number of rows\n");
scanf("%d", &rows);
printf("Enter number of columns\n");
scanf("%d", &col);
int
a1[rows][col],a2[rows][col],sum[rows][col];
// Addition of matrix.
for(i=0; i<rows; i++)
{
for(j=0; j<col; j++)
{
sum[i][j] = a1[i][j] + a2[i][j];
}
}
return 0;
}
OUTPUT – 2