Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

// Program of Array...Saying..Array means coninuous memory location only..

// Nothing other than this....Whatever You can store on those locations.


// By: Pawan Kumar
#include<stdio.h>
#include<conio.h>

int main()
a
{
int i;
int a[5]={'a','b',12,13,14};
for(i=0;i<5;i++)
a b 12 13 14
1000 1002 1004 1006 1008
{
printf("Printing element %d th of Array:",i);
if(i==0 || i==1)
{
a ,(a+1) ,(a+2),(a+3),(a+4)
printf("%c\n",a[i]);
} *a=*(1000)=a[0]
else
{
printf("%d\n",a[i]);
}
}
printf("\n\nPrinting continuous Address space of array a:\n");
printf("%u\n",a);
printf("%u\n",a+1);
printf("%u\n",a+2);
printf("%u\n",a+3);
printf("%u\n",a+4);

getch();
return(0);
}
/*
Output:

Printing element 0 th of Array:a


Printing element 1 th of Array:b
Printing element 2 th of Array:12
Printing element 3 th of Array:13
Printing element 4 th of Array:14
Printing continuous Address space of array a:
6422150
6422152
6422154
6422156
6422158
*/

You might also like