
362 Programming in C
clrscr();
for(i=0;i<5;i++)
{
printf(“\n\t%d at location”,*(*p+i));
printf(“\t%u at location”,*(p+i));
printf(“%u”,p+i);
}
printf(“\n\n Integer requires 2 bytes, pointer require 2 bytes”);
}
OUTPUT:
0 at location 4036 at location 4046
1 at location 4038 at location 4048
2 at location 4040 at location 4050
3 at location 4042 at location 4052
4 at location 4044 at location 4054
Integer requires 2 bytes, pointer require 2 bytes
Explanation:
In the above program, the first for loop assigns addresses of the elements of integer
array to the pointer array. The first printf() statement prints elements, the