#include <stdio.h> int main() { Â int row,col, i, j, first[10][10], second[10][10], sum[10][10]; Â printf("Enter the number of rows and columns of matrix\n"); Â scanf("%d %d", &row, &col); Â printf("Enter the elements of first matrix\n"); Â for (i = 0; i < row; i++) Â for (j = 0; j < col; j++) scanf("%d", &first[i][j]); Â printf("Enter the elements of second matrix\n"); Â for (i = 0; i < row; i++) Â for (j = 0; j < col; j++) scanf("%d", &second[i][j]); Â printf("Sum of entered matrices:-\n"); Â for (i = 0; i <row; i++) Â { Â for (j = 0; j < col; j++) Â { Â sum[i][j] = first[i][j] + second[i][j]; Â printf("%d\t", sum[i][j]); Â } Â printf("\n"); Â } Â return 0; }
Team Answered question April 13, 2024