#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
void main()
{
int i,n; //number of ements of array x
int x[]={80,90,100,50,65,70};
n= sizeof(x)/sizeof(int);
printf("\n size of data type <int>%d ", sizeof(int));
printf("\n Memory space allocated to x[6] : %d ", sizeof(x));
printf("\n no of elements in array x = %d",n);
// %u displays the address in unsigned decimal integer
// %x displays the address in hexa with 0x omitted.
printf("\n array elements\t:\taddress ");
printf("\naddress in unsigned decimal integer");
for (i=0;i<n; i++)
printf("\n%d\t:\t%u\t:\t%x", x[i],&x[i],&x[i]);
printf("\n");
system("pause");
}
hasilnya
No comments:
Post a Comment