Anyone of you guys can help me writing a programe usuing the foor loop twice or more and that will add the two matrices (A):- |A11 A12 . . .A1m| | | |A21 . | m*m | . | |Am1 . | and (B):- |B11 B12 . . .B1n| | | |B21 . | m*m | . | |Bn1 . | M: POSITIVE INTEGER Please send it to my email ( maxe5000@hotmail.com ) and Thanx very much.
Anyone of you guys can help me writing a programe usuing the foor loop twice or more and that will add the two matrices You will need to make that clearer, possibly by using pre and /pre Please send it to my email The purpose of a forun is that everyone can see the answer. Erik
well..u can consider me stupid in C++ and I needed this solution for some important reason..someone has directed me to this site and told me that there should be someone there who can help me I dont know how to fix it more than I did Ill try to retype it clearer in a matrix shape (A):- |A11 A12 . . .A1m| |................| |A21.............| m*m |................| |Am1.............| and (B):- |B11 B12 . . .B1n| |................| |B21.......... ..| m*m |................| |Bn1.............| these are the two matrices..and I just need a simple programe using the ( for loop ) for adding these two matrices together. M: POSITIVE INTEGER
I will assume that the elements of your matrices A and B are integers, since you didn't say otherwise, that a constant "m" is #defined somewhere for their dimension, and that they are within scope somehow (via extern, etc.) Also, I'm assuming that their dimension is less than 65536.
unsigned int C[m][m]; unsigned int i; unsigned int j; for (i = 0; i < m; i++) { for (j = 0; j < m; j++) { C[i][j] = A[i][j] + B[i][j]; } }
"There... now your teacher will think you know how to do it." You could also try: http://www.essayrelief.com
View all questions in Keil forum