0% found this document useful (0 votes)
6 views

2 Darray

Uploaded by

homelander495
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

2 Darray

Uploaded by

homelander495
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

1.

// #include<iostream>
// using namespace std;
// int main()
// {
// int m, n, sum=0;
// int a[3][4] , b[4][2] ,r[3][2];
// cout<<"Enter your fist matrix";
// for(int i=0 ; i<3 ;i++)
// {
// for(int j=0 ; j<4 ;j++)
// {
// cin>>a[i][j];
// }
// }

// cout<<"Enter your second matrix";

// for(int i=0 ; i<4 ;i++)


// {
// for(int j=0 ; j<2 ;j++)
// {
// cin>>b[i][j];
// }
// }

// for(int i=0 ; i<3 ;i++)


// {
// for(int j=0 ; j<2 ;j++)
// {
// for(int k=0 ; k<4 ; k++)
// {
// sum+=a[i][k]*b[k][j];

// }
// r[i][j]=sum;
// sum=0;

// }
// }

// for(int i=0 ; i<3 ;i++)


// {
// for(int j=0 ; j<2 ;j++)
// {
// cout<<r[i][j]<<" ";

// }
// cout<<endl;

// }
// return 0;
// }
2.
// #include<iostream>
// using namespace std;
// int main ()
// {
// int m, n, i, j, A[10][10];
// cout << "Enter the number of rows and columns of the matrix : ";
// cin >> m >> n;
// cout << "Enter the array elements : ";
// for (i = 0; i < m; i++)
// for (j = 0; j < n; j++)
// cin >> A[i][j];
// cout << "Matrix : \n ";
// for (i = 0; i < m; i++)
// {
// for (j = 0; j < n; j++)
// cout << A[i][j] << " ";
// cout << "\n ";
// }
// if (m == n)
// cout << "The entered array is a square matrix.";
// else
// {
// cout << "The entered array is not a square matrix.";
// exit(0);
// }
// cout << "The diagonal elements are : \n";
// for (i = 0; i < m; i++)
// {
// for (j = 0; j < n; j++)
// {
// if (i == j)
// cout << A[i][j];
// else
// cout << " ";
// }
// cout << "\n";
// }
// return 0;
// }

You might also like