Take an int array of size 5 with different integer values. Now refer the pointer to array and then take the address of each element of array and then display the content of that element through pointer ?

#include<iostream>
using namespace std;
int main()
{
const int size =5;
int array[size]={9,2,5,8,3};
int *ptr;

for(int i=0;i<size;i++)
{
ptr=&array[i];
cout << *ptr << endl;
}
return 0;
}