#include<iostream>
#include<conio.h>
using namespace std;
int main()
{
int a = 1, b = 2, c = 3, d = 4;
int *w = &a, *x = &b, *y = &c, *z = &d;
int &p = a, &q = b, &r = c, &s = d;
int *arr1[4] = { w, x, y, z };
int arr2[4] = { p, q, r, s };
for (int i = 0; i < 4; i++)
{
//printing values using pointers
cout << *arr1[i] << " ";
//printing values using references
cout << arr2[i] << endl;
}
getch();
return 0;
}