Answer:
#include<iostream>
using namespace std;
int main()
{
int a[20],n;
int *p;
cout<<"\\ enter how many values do you want to enter:";
cin>>n;
for(int i=0;i<n;i++)
{
cout<<"\\ Enter the "<<i+1 <<"th value :";
cin>>*(p+i);
//reading the values into the array using pointer
}
cout<<"\\ The values in the array using pointer is:\\";
for(int i=0;i<n;i++)
{
cout<<"\\ (p+"<<i<<"): "<<*(p+i);
//here we can use both *(p+i) or p[i] both are pointer subscript notations
}
}
Output: