Searching...
Friday, 22 July 2016

C++ Program : How to Make and Display Matrices using an Array

19:59:00

C++ Program : How to Make and Display Matrices using an Array :

#include <iostream>

using namespace std;

int main()
{
    int arr[3][3];
    cout << "Enter 9 elements of Matrices : " ;
    for(int i=0; i<3; i++)
    {
        for(int j=0; j<3; j++)
        {
            cin >> arr[i][j];
        }
    }
    cout << "The Elements in Matrices Form is : " << endl;
    for(int i=0; i<3; i++)
    {
        for(int j=0; j<3; j++)
        {
            cout << arr[i][j] << " " ;
        }
        cout << endl;
    }
}

Output :

C++ Program : How to Make and Display Matrices using an Array
C++ Program : How to Make and Display Matrices using an Array

0 comments:

Post a Comment