Not as eloquent as the first but a bit more efficient.
Code:
#include "stdafx.h"
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
int x, y;
cout << "Enter number of arrays: " << flush;
cin >> x;
cout << "Enter the number in each array : " << flush;
cin >> y;
int * pArry = new int[ x * y ];
if( !pArry )
throw bad_alloc( );
for ( int i = 0; i < x; i++ )
{
for( int j = 0; j < y; j++ )
{
(pArry + i)[ j ] = j + i;
}
}
for ( i = x - 1; 0 <= i; i-- )
{
for( int j = y - 1; 0 <= j; j-- )
{
cout << " j = " << j << " i = " << i << " j + i = pArry[i][j] = " << (pArry + i )[ j ] << endl;
}
}
delete pArry[];
return 0;
}