C program for size of array
#include <stdio.h>
int
main( )
{
int
i,num;
printf
(
"\nEnter the hoe many elements you want?\n"
);
scanf
(
"%d"
,&num);
int
a[num];
printf
(
"\nEnter the %d elements:\n"
,num);
for
(i=0;i<num;i++)
{
scanf
(
"%d"
,&a[i]);
}
printf
(
"Elements in array are:\n"
);
for
(i=0;i<num;i++)
{
printf
(
"%d\n"
,a[i]);
}
printf
(
" The size of the array is: %d Bytes."
,(
int
)
sizeof
(a));
return
0 ;
}
Output:
Post a Comment