int main()
{
int i,n,*p;
//Allocate the memory based on user given size
printf("\n Enter the Number of Elements\n");
scanf("%d",&n);
p=(int*)malloc(n*sizeof(int)); // if elements is equal to 2 then 2x4(size of int)=8 bytes will be allocated
// PRINT THE MEMORY LOCATION
for(i=0;i less than n;i++)
{
printf("\nMemory Location of %d is :::: %d",i,&p[i]);
}
// GET THE ELEMENTS FROM USER ON MEMORY LOCATIONS
for(i=0;i less than n;i++)
{
printf("\n Enter the Element %d \t ",i);
scanf("%d",&*(p+i));
}
//PRINT THE ELEMENTS
printf("\n ::::Elements::::\n");
for(i=0;i less than n;i++)
{
printf("\n%d\n",*(p+i));
}
return 0;
}