# Add Two Matrix C Code

This program will first ask user to enter the number of rows and columns for the two matrices. Remember, they have to be the same for both of the matrices. Then the program will ask the user to enter the elements of the first matrix and then the elements of the second matrix in the fashion:

First Matrix :-
2 3
4 5
Second matrix :-
3 4
5 6
then output of the program will be :-
5 7
9 11

### Here is the C Code to Add Two Matrix:

```/* Double-Click To Select Code */
#include <stdio.h>
#include <conio.h>

void main()
{
int m, n, c, d, first, second, sum;

printf("Enter the number of rows and columns of matrix\n");
scanf("%d%d", &m, &n);
printf("Enter the elements of first matrix\n");

for (c = 0; c < m; c++)
for (d = 0; d < n; d++)
scanf("%d", &first[c][d]);

printf("Enter the elements of second matrix\n");

for (c = 0; c < m; c++)
for (d = 0 ; d < n; d++)
scanf("%d", &second[c][d]);

printf("Sum of entered matrices:-\n");

for (c = 0; c < m; c++) {
for (d = 0 ; d < n; d++) {
sum[c][d] = first[c][d] + second[c][d];
printf("%d\t", sum[c][d]);
}
printf("\n");
}
}
```

Output:
{"ft_lang_label":"__label__en","ft_lang_prob":0.65370107,"math_prob":0.99704194,"size":1323,"snap":"2021-31-2021-39","text_gpt3_token_len":420,"char_repetition_ratio":0.13798332,"word_repetition_ratio":0.3125,"special_character_ratio":0.38473168,"punctuation_ratio":0.17133956,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99881124,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-08-01T19:55:12Z\",\"WARC-Record-ID\":\"<urn:uuid:be4cca45-202e-4f85-988f-87225d9f3de7>\",\"Content-Length\":\"101386\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:13809ab8-bfef-4799-b6e1-cab2a004a32c>\",\"WARC-Concurrent-To\":\"<urn:uuid:4c476da5-d174-4725-b087-af24f2cf8d19>\",\"WARC-IP-Address\":\"172.67.132.241\",\"WARC-Target-URI\":\"https://www.codingbot.net/2016/12/add-two-matrix-c-code.html\",\"WARC-Payload-Digest\":\"sha1:JZYHKWFRQLZ7TGXBNL65UOHCG54HUECQ\",\"WARC-Block-Digest\":\"sha1:XATOXFDICB2T53344JEJAPJH6VQVZDRN\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-31/CC-MAIN-2021-31_segments_1627046154219.62_warc_CC-MAIN-20210801190212-20210801220212-00399.warc.gz\"}"}