Programming Logics FORUMS

Full Version: C++ - Matrix Multiplication
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
write a program that will multiply two dimentional arrays as follow:

1. The program should prompt the user for the dimention of the first array (row x coloum).
2. The program should get the values of the first array one by one. (e.g. program should display "enter value of a[1][1]= , ...etc"
3. The program should prompt the user for the dimention of the second array.
4. If the dimention of the second array is not compatible with the first array (can not multiply with), then refuse to accept the second array and ask the user again for the dimention of the second array.

5. The program should get the values of the second array one by one.
6. The program should calculate the multiplication and store the result in third matrix (array)
7. The program should print the result of the multiplication in an organized way.


PS : you should ask to enter values starting from 1 to n not from 0 to n-1 in the arrary, and you should store them in location.
These FORUMS are supposed to solve the problems faced during programming
not making full assignments
Ammar26 is absolutely rigjht but still I will give the hint of the program. You just use c[i][j]+=a[i][k]*b[k][j] as your main formula then your problem will solved and the answer will come definitely.
Reference URL's