Go to the documentation of this file.
4 float** temp =
new float*[n];
5 for (
int i = 0;
i < n;
i++)
6 temp[
i] =
new float[n];
11 std::cout <<
"Enter matrix: " << std::endl;
12 for (
int i = 0;
i < n;
i++)
13 for (
int j = 0;
j < n;
j++)
15 std::cout << std::endl;
19 for (
int i = 0;
i < n;
i++) {
20 for (
int j = 0;
j < n;
j++)
21 std::cout <<
M[
i][
j] <<
" ";
22 std::cout << std::endl;
24 std::cout << std::endl;
27 float**
add(
float** M1,
float** M2,
int n) {
29 for (
int i = 0;
i < n;
i++)
30 for (
int j = 0;
j < n;
j++)
31 temp[
i][
j] = M1[
i][
j] + M2[
i][
j];
35 float**
subtract(
float** M1,
float** M2,
int n) {
37 for (
int i = 0;
i < n;
i++)
38 for (
int j = 0;
j < n;
j++)
39 temp[
i][
j] = M1[
i][
j] - M2[
i][
j];
void input(float **M, int n)
float ** subtract(float **M1, float **M2, int n)
void printMatrix(float **M, int n)
float ** add(float **M1, float **M2, int n)
float ** initializeMatrix(int n)