current position:Home>How to find the sum of all elements of 2 times 2 Matrix in C language

How to find the sum of all elements of 2 times 2 Matrix in C language

2022-01-27 00:35:36 CSDN Q & A

seek .




Refer to the answer 1:
#include<stdio.h>int main() {    int a[2][2];    int res=0;    for (int i = 0; i < 2; i++)    {        for (int j = 0; j < 2; j++)        {            printf(" Enter the first %d That's ok ,%d The value of the column :",i,j);            scanf("%d",a[i][j]);            res += a[i][j];        }    }    printf(" And for :%d", res);    return 0;}



Refer to the answer 2:

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.cdmana.com/2022/01/202201270035351532.html

Random recommended