Program to enter n number of elements using concept of pointer to array

#include
#include
main()
{
int *a,n,i;
float contains;
clrscr();
cout<>n;
cout<<"n Enter the elements n";
for(i=0;i<n;i++)
{
cout<<"n A["<<i<>*(a+i);
}
cout<<"nnn";
cout<<"n Entered elements of array were";
for(i=0;i<n;i++)
{
cout<<"n Addess Location"<<(a+i)<<"
contains value A["<<i<<"]="<<*(a+i);
}
getch();
}

Leave a reply