Search your topic here

Memory Implementation of 2D Array.

PRINCIPLES OF PROGRAMMING LANGUAGES
PRACT. Memory Implementation of 2D Array. 

#include <iostream>
using namespace std;

int main()
{
    int arr[3][2];
    cout << "Enter 06 values: \n";
 
    for (int j = 0; j < 3; ++j)
    {
        for(int k = 0; k < 2; ++k )
        {
            cin >> arr[j][k];
        }
    }

    cout<<"\nDisplaying Value stored:"<<endl;

    for(int j = 0; j < 3; ++j)
    {
        for(int k = 0; k < 2; ++k)
        {
            cout<< "arr[" << j << "][" << k << "] = " << arr[j][k] << endl;
        }
    }

    return 0;
}

LEAVE A REPLY










Related topics

Please use contact page in this website if you find anything incorrect or you want to share more information about the topic discussed above.