Take an int array of size 5 with different integer values. Now refer the pointer to array and then use pointer to display contents of array (in a loop, using array notation) ?

#include<iostream>
using namespace std;

int main()
{
const int size =5;
int array[size]={9,2,5,8,3};
int *ptr;

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

return 0;
}