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

continuous

// 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()
{
int i;
int a[5]={'a','b',12,13,14};
for(i=0;i<5;i++)
{
printf("Printing element %d th of Array:",i);
if(i==0 || i==1)
{
printf("%c\n",a[i]);
}
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:


6422152
6422156
6422160
6422164
6422168
*/

You might also like